Skip to content

ci: add PR build and test workflow#5

Merged
mpaulosky merged 3 commits into
mainfrom
squad/ci-workflow
Apr 18, 2026
Merged

ci: add PR build and test workflow#5
mpaulosky merged 3 commits into
mainfrom
squad/ci-workflow

Conversation

@mpaulosky

Copy link
Copy Markdown
Owner

Adds GitHub Actions CI workflow that runs on PRs with build checks, test results reporting, and code coverage.

What this adds

  • Build validation — compiles the solution in Release mode
  • Test execution — runs all three test suites (Architecture, Unit, Integration)
  • Code coverage — collects coverage metrics using coverlet
  • PR annotations — test failures appear inline on PR diff via dorny/test-reporter
  • Coverage reports — posts coverage summary as PR comment using irongut/CodeCoverageSummary
  • NuGet caching — speeds up builds by caching packages

Workflow triggers

  • Pull requests targeting main
  • Pushes to main

Notes

  • Integration tests use Testcontainers for MongoDB (handled automatically in CI)
  • Unit tests already have 92.04% coverage with threshold enforcement
  • Build skips Tailwind CSS compilation in CI (see Web.csproj target)

Closes no issue — infrastructure improvement requested by @mpaulosky.

mpaulosky and others added 2 commits April 18, 2026 12:03
- 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>
Copilot AI review requested due to automatic review settings April 18, 2026 19:03
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread .github/workflows/ci.yml
Comment on lines +3 to +7
on:
pull_request:
branches:
- main
- 'squad/**'

Copilot AI Apr 18, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/ci.yml
Comment on lines +74 to +105
- 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

Copilot AI Apr 18, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/ci.yml
Comment on lines +28 to +29
dotnet-version: '10.0.x'
dotnet-quality: 'preview'

Copilot AI Apr 18, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
dotnet-version: '10.0.x'
dotnet-quality: 'preview'
global-json-file: global.json

Copilot uses AI. Check for mistakes.
@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Branch Rate Complexity Health
Domain 0% 0% 38
Web 0% 0% 332
ServiceDefaults 0% 0% 18
Domain 0% 0% 38
Web 0% 0% 332
ServiceDefaults 0% 0% 18
AppHost 0% 100% 1
Domain 43% 0% 38
Web 5% 5% 332
ServiceDefaults 0% 0% 18
AppHost 0% 100% 1
Domain 43% 0% 38
Web 5% 5% 332
ServiceDefaults 0% 0% 18
Domain 93% 50% 38
Web 65% 64% 332
ServiceDefaults 0% 0% 18
Domain 93% 50% 38
Web 65% 64% 332
ServiceDefaults 0% 0% 18
Summary 23% (1020 / 4364) 21% (344 / 1608) 2330

@mpaulosky
mpaulosky merged commit 70c81d9 into main Apr 18, 2026
2 checks passed
@mpaulosky
mpaulosky deleted the squad/ci-workflow branch April 18, 2026 19:15
mpaulosky added a commit that referenced this pull request Apr 18, 2026
- 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants