Skip to content

Commit

Permalink
feat: added matrix builds
Browse files Browse the repository at this point in the history
  • Loading branch information
woutervanranst committed Oct 9, 2024
1 parent 8177fb5 commit ebd9b1d
Showing 1 changed file with 29 additions and 6 deletions.
35 changes: 29 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,19 @@ permissions: # Required for dorny/test-reporter@v1
jobs:
ci:
name: CI Build and Test
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
timeout-minutes: 15
defaults:
run:
working-directory: src

strategy:
matrix:
os: [ubuntu-latest, windows-latest]
exclude:
- os: ubuntu-latest
project: Arius.UI # Exclude Windows-specific project on Ubuntu

steps:
- name: Check out code
uses: actions/checkout@v4
Expand All @@ -29,25 +36,41 @@ jobs:
dotnet-version: 8.x

- name: Restore NuGet Packages
run: dotnet restore
run: |
if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then
dotnet restore --ignore-failed-sources || true
else
dotnet restore
fi
- name: Build Solution
run: dotnet build --configuration Release
run: |
if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then
dotnet build --configuration Release --no-restore --ignore-failed-sources || true
else
dotnet build --configuration Release --no-restore
fi
- name: Run Unit Tests
run: dotnet test Arius.Core.Tests --configuration Release --no-build --verbosity normal --logger "junit;LogFilePath=../results/test-results.xml" --collect:"XPlat Code Coverage"
run: |
if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then
dotnet test Arius.Core.Tests --configuration Release --no-build --verbosity normal --logger "junit;LogFilePath=../results/test-results.xml" --collect:"XPlat Code Coverage"
else
dotnet test Arius.Core.Tests --configuration Release --no-build --verbosity normal --logger "junit;LogFilePath=../results/test-results.xml" --collect:"XPlat Code Coverage"
dotnet test Arius.UI.Tests --configuration Release --no-build --verbosity normal --logger "junit;LogFilePath=../results/test-results-ui.xml" --collect:"XPlat Code Coverage"
fi
- name: Test Report
uses: dorny/test-reporter@v1
if: always()
with:
name: Test Report
path: "**/test-results.xml"
path: "**/test-results*.xml"
reporter: java-junit

- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: "**/coverage.cobertura.xml"
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
fail_ci_if_error: true

0 comments on commit ebd9b1d

Please sign in to comment.