ci: split backend restore/build/test into separate steps
CI and Deploy / test (push) Failing after 1m0s
CI and Deploy / deploy (push) Has been skipped

The backend test step fails on the self-hosted runner after 8s while passing
on Windows, in a clean Linux container, and in CI's exact build-then-test
order. The job log is not readable via the Gitea API (401), so step boundaries
are the only available telemetry: splitting restore / build / test makes the
failing phase identifiable from step timings alone.

Restore retries once, mirroring the npm ci and dotnet SDK retries already in
this workflow for the same runner's known flakiness. The suite itself is
unchanged — still the whole suite, nothing filtered or skipped.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
cesnimda
2026-07-18 21:35:16 +02:00
parent cfba7fbbc4
commit 45725acc7c
+14 -4
View File
@@ -40,11 +40,21 @@ jobs:
- name: Build backend
run: dotnet build JobTrackerApi/JobTrackerApi.csproj --configuration Release
# No --no-build: the build step above only builds JobTrackerApi, so the test project was never
# compiled and `--no-build` made this step a ~1s no-op (or ran a stale binary left on the
# self-hosted runner). The backend suite was therefore not actually gating CI.
# The "Build backend" step above only builds JobTrackerApi, so the test project needs its own
# restore + build. These are separate steps on purpose: this runner is flaky (see the SDK and
# npm retries in this file) and the job log is not readable from the API, so distinct steps make
# the failing phase identifiable from step boundaries alone. Restore retries once, mirroring the
# npm ci pattern below. The suite itself is never weakened or filtered.
- name: Restore backend tests
run: |
restore() { dotnet restore JobTrackerApi.Tests/JobTrackerApi.Tests.csproj; }
restore || ( echo "NuGet restore failed ($?) — retrying once..." && restore )
- name: Build backend tests
run: dotnet build JobTrackerApi.Tests/JobTrackerApi.Tests.csproj --configuration Release --no-restore
- name: Test backend
run: dotnet test JobTrackerApi.Tests/JobTrackerApi.Tests.csproj --configuration Release
run: dotnet test JobTrackerApi.Tests/JobTrackerApi.Tests.csproj --configuration Release --no-build
- name: Install frontend deps
working-directory: job-tracker-ui