From 02c884d658ec5e110965d99295b29806fb6ed550 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 28 Jul 2026 17:40:17 +0000 Subject: [PATCH] Add manually triggered unit test workflow Runs the test suite only on demand - via the "run-tests" label on a PR or a manual workflow_dispatch - rather than on every commit. Capped at a 5 minute timeout. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_012oge96jtAWEQm9iCDZ2Dpi --- .github/workflows/tests.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..ef7ef93 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,34 @@ +name: Unit tests + +# Manually triggered only - so tests can be run once PR comments are resolved, +# instead of on every push. +# +# Two ways to trigger: +# 1. Add the "run-tests" label to a pull request (re-add it to re-run). +# 2. Actions -> "Unit tests" -> "Run workflow" and pick a branch. +on: + pull_request: + types: [labeled] + workflow_dispatch: + +jobs: + test: + # For the label trigger, only react to the "run-tests" label. + if: github.event_name == 'workflow_dispatch' || github.event.label.name == 'run-tests' + runs-on: ubuntu-latest + timeout-minutes: 5 + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: "10.0.x" + + - name: Restore + run: dotnet restore Shoebox.slnx + + - name: Test + run: dotnet test Shoebox.slnx --configuration Release --no-restore