@@ -2,18 +2,27 @@ name: CI
22
33on :
44 push :
5- branches : [ main ]
5+ branches : [main]
66 pull_request :
7- branches : [ main ]
7+ branches : [main]
88 workflow_dispatch :
99
1010permissions :
1111 contents : read
1212
13+ concurrency :
14+ group : ci-${{ github.workflow }}-${{ github.ref }}
15+ cancel-in-progress : true
16+
17+ env :
18+ DOTNET_NOLOGO : true
19+ DOTNET_CLI_TELEMETRY_OPTOUT : true
20+
1321jobs :
14- build :
15- name : Restore and build
22+ build-test :
23+ name : Build, test, and repository health
1624 runs-on : windows-latest
25+ timeout-minutes : 25
1726
1827 steps :
1928 - name : Checkout
@@ -24,23 +33,30 @@ jobs:
2433 with :
2534 dotnet-version : 8.0.x
2635
36+ - name : Repository health gate
37+ shell : pwsh
38+ run : .\scripts\repository-health.ps1
39+
2740 - name : Restore
2841 run : dotnet restore .\ProcessBusSuite.sln
2942
3043 - name : Build
3144 run : dotnet build .\ProcessBusSuite.sln -c Release --no-restore /p:ContinuousIntegrationBuild=true
3245
33- - name : Run tests when present
34- shell : pwsh
35- run : |
36- $testProjects = Get-ChildItem -Path . -Recurse -Filter *.csproj |
37- Where-Object { $_.FullName -match '(Test|Tests)\\|\.(Test|Tests)\.csproj$' }
38-
39- if (-not $testProjects) {
40- Write-Host "No test project found. Build validation completed."
41- exit 0
42- }
43-
44- foreach ($project in $testProjects) {
45- dotnet test $project.FullName -c Release --no-build --logger "trx"
46- }
46+ - name : Test with coverage
47+ run : >-
48+ dotnet test .\ProcessBusSuite.sln
49+ -c Release
50+ --no-build
51+ --logger "trx;LogFileName=tests.trx"
52+ --results-directory .\TestResults
53+ --collect "XPlat Code Coverage"
54+
55+ - name : Upload test evidence
56+ if : always()
57+ uses : actions/upload-artifact@v4
58+ with :
59+ name : test-evidence-${{ github.run_id }}
60+ path : TestResults/**
61+ if-no-files-found : warn
62+ retention-days : 14
0 commit comments