From cc8496aa858141954275924e8224a90b4f74d259 Mon Sep 17 00:00:00 2001 From: maj00r Date: Sun, 4 Oct 2026 13:25:23 +0200 Subject: [PATCH] Run the tests before building the packages --- .github/workflows/dotnet.yml | 37 ++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 9ad94e7..1b07c31 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -20,11 +20,48 @@ env: DOTNET_CLI_TELEMETRY_OPTOUT: 1 DOTNET_NOLOGO: true PROJECT_PATH: StarterNG/StarterNG.csproj + TEST_PROJECT_PATH: StarterNG.Tests/StarterNG.Tests.csproj jobs: + # On both systems the packages are built for: paths, encodings and the file + # system differ, and that is where these tests earn their keep. + test: + name: Tests (${{ matrix.name }}) + + strategy: + fail-fast: false + + matrix: + include: + - name: Windows x64 + os: windows-2022 + + - name: Linux x64 + os: ubuntu-22.04 + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout repository + uses: actions/checkout@v7 + + - name: Setup .NET 9 + uses: actions/setup-dotnet@v6 + with: + dotnet-version: 9.0.x + + - name: Test + run: > + dotnet test + "${{ env.TEST_PROJECT_PATH }}" + -c Release + publish: name: ${{ matrix.name }} + # A failing test stops the packages, and with them the rolling pre-release. + needs: test + strategy: fail-fast: false