diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b364fc2..430b68a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,28 +7,64 @@ on: branches: [master] workflow_dispatch: +concurrency: + group: ci-${{ github.head_ref || github.ref }} + cancel-in-progress: true + jobs: - test: + lint: runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: | + 8.0.x + 9.0.x + 10.0.x + - name: Restore tools + run: dotnet tool restore + + - name: Check formatting + run: dotnet csharpier check . + + - name: Restore + run: dotnet restore + + - name: Build (warnings as errors) + run: dotnet build -c Release --no-restore -warnaserror + + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + framework: [net8.0, net9.0, net10.0] steps: - uses: actions/checkout@v4 - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: '10.0.x' + dotnet-version: | + 8.0.x + 9.0.x + 10.0.x - name: Restore run: dotnet restore - - name: Build - run: dotnet build -c Release --no-restore + - name: Build (${{ matrix.framework }}) + run: dotnet build -c Release --no-restore --framework ${{ matrix.framework }} - - name: Test - run: dotnet test -c Release --no-build --verbosity normal --collect:"XPlat Code Coverage" + - name: Test (${{ matrix.framework }}) + run: dotnet test -c Release --no-build --framework ${{ matrix.framework }} --collect:"XPlat Code Coverage" - name: Upload coverage to Codecov + if: matrix.framework == 'net10.0' uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }}