From 45725acc7c7773dc94dd161808a4d6eecbb2c92c Mon Sep 17 00:00:00 2001 From: cesnimda Date: Sat, 18 Jul 2026 21:35:16 +0200 Subject: [PATCH] ci: split backend restore/build/test into separate steps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .gitea/workflows/ci-deploy.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/ci-deploy.yml b/.gitea/workflows/ci-deploy.yml index 462e760..4216060 100644 --- a/.gitea/workflows/ci-deploy.yml +++ b/.gitea/workflows/ci-deploy.yml @@ -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