ci: add PR build and test workflow#5
Conversation
- Build solution in Release mode - Run all three test suites (Architecture, Unit, Integration) - Collect code coverage with coverlet - Report test results with dorny/test-reporter - Post coverage summary as PR comment - Cache NuGet packages for faster builds Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Scribe: Finalize session completion for Legolas razor-imports work - Write orchestration logs (Legolas & Boromir) - Write session log for PR #4 merge - Merge decision inbox → decisions.md - Remove processed inbox files Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds a GitHub Actions CI workflow to validate builds and execute all test suites on PRs and main, publishing TRX-based test reporting and coverage summaries back to the PR.
Changes:
- Introduces a new CI workflow that restores, builds (Release), and runs Architecture/Unit/Integration test projects.
- Publishes TRX test results to GitHub Checks and uploads Cobertura coverage artifacts.
- Generates a coverage summary and posts/updates a sticky PR comment with the coverage report.
| on: | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| - 'squad/**' |
There was a problem hiding this comment.
PR metadata says the workflow should run for pull requests targeting main, but the trigger also includes pull_request.branches: 'squad/**' (i.e., PRs targeting squad branches). Either remove the extra branch pattern or update the PR description to match the actual triggers.
| - name: Publish Test Results | ||
| uses: dorny/test-reporter@v1 | ||
| if: always() | ||
| with: | ||
| name: Test Results | ||
| path: 'test-results/**/*.trx' | ||
| reporter: dotnet-trx | ||
| fail-on-error: true | ||
|
|
||
| - name: Upload Coverage Reports | ||
| uses: actions/upload-artifact@v4 | ||
| if: always() | ||
| with: | ||
| name: coverage-reports | ||
| path: test-results/**/coverage.cobertura.xml | ||
| retention-days: 30 | ||
|
|
||
| - name: Code Coverage Summary | ||
| uses: irongut/CodeCoverageSummary@v1.3.0 | ||
| if: always() | ||
| with: | ||
| filename: 'test-results/**/coverage.cobertura.xml' | ||
| badge: true | ||
| format: markdown | ||
| output: both | ||
|
|
||
| - name: Add Coverage Comment | ||
| uses: marocchino/sticky-pull-request-comment@v2 | ||
| if: github.event_name == 'pull_request' && always() | ||
| with: | ||
| recreate: true | ||
| path: code-coverage-results.md |
There was a problem hiding this comment.
Steps that write check-runs / PR comments (e.g., dorny/test-reporter and sticky-pull-request-comment) will fail on pull requests from forks because GITHUB_TOKEN does not get checks: write / pull-requests: write on forked PRs. Consider gating these steps to only run when github.event.pull_request.head.repo.full_name == github.repository (or similar), so fork PRs still build/test without the workflow erroring during reporting/commenting.
| dotnet-version: '10.0.x' | ||
| dotnet-quality: 'preview' |
There was a problem hiding this comment.
The workflow installs a preview .NET SDK (dotnet-quality: 'preview') while global.json pins 10.0.100 with allowPrerelease: false, which can cause CI to fail due to SDK version mismatch. Prefer installing the exact SDK from global.json (or using global-json-file) and drop the preview quality unless the repo intentionally targets prerelease SDKs.
| dotnet-version: '10.0.x' | |
| dotnet-quality: 'preview' | |
| global-json-file: global.json |
|
- Merge decision inbox file into .squad/decisions.md with: - CI workflow security review (PR #5) - Template cleanup security review (PR #6) - Copyright header decision (PR #7) - Delete gandalf-pr5-pr6-merged.md from decisions/inbox/ - Add orchestration log with full PR merge details - Add session log summarizing board clear status PRs #5 (CI workflow), #6 (template cleanup), #7 (copyright headers) all merged to main by Gandalf. All 74 tests passing, 91.64% coverage. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds GitHub Actions CI workflow that runs on PRs with build checks, test results reporting, and code coverage.
What this adds
Workflow triggers
mainmainNotes
Closes no issue — infrastructure improvement requested by @mpaulosky.