Add multi-platform tests to verify compatibility #35
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: 🔎 | |
| on: | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| build: | |
| name: Test & Coverage | |
| runs-on: ubuntu-latest | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| DOTNET_ROLL_FORWARD: Major | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install msquic | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libmsquic | |
| - name: Download .NET SDK | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 9.0 | |
| - name: Restore tools | |
| run: dotnet tool restore | |
| - name: Begin scan | |
| if: env.SONAR_TOKEN != null && env.SONAR_TOKEN != '' | |
| run: dotnet sonarscanner begin /k:"GenHTTP" /d:sonar.token="$SONAR_TOKEN" /d:sonar.cs.opencover.reportsPaths="**/coverage.opencover.xml" /d:sonar.exclusions="**/bin/**/*,**/obj/**/*,**/Playground/**/*,**/*.css,**/*.js,**/*.html" /o:"kaliumhexacyanoferrat" /k:"GenHTTP" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.branch.name="${GITHUB_REF##*/}" /d:sonar.dotnet.excludeTestProjects=true | |
| - name: Build project | |
| run: dotnet build GenHTTP.slnx -c Release | |
| - name: Test project | |
| run: dotnet test GenHTTP.slnx --no-build --collect:"XPlat Code Coverage" -c Release -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover | |
| - name: End scan | |
| if: env.SONAR_TOKEN != null && env.SONAR_TOKEN != '' | |
| run: dotnet sonarscanner end /d:sonar.token="$SONAR_TOKEN" | |
| verify: | |
| name: ${{ matrix.os.name }} / .NET ${{ matrix.dotnet }} / ${{ matrix.arch }} | |
| needs: build | |
| runs-on: ${{ matrix.os.runs-on }} | |
| env: | |
| TEST_ENGINE: Internal | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # Linux x64 | |
| - os: | |
| name: 🐧 | |
| runs-on: ubuntu-latest | |
| arch: x64 | |
| runtime: linux-x64 | |
| platform: linux/amd64 | |
| dotnet: 8.0 | |
| - os: | |
| name: 🐧 | |
| runs-on: ubuntu-latest | |
| arch: x64 | |
| runtime: linux-x64 | |
| platform: linux/amd64 | |
| dotnet: 9.0 | |
| # Linux arm64 | |
| - os: | |
| name: 🐧 | |
| runs-on: ubuntu-22.04-arm | |
| arch: arm64 | |
| runtime: linux-arm64 | |
| platform: linux/arm64/v8 | |
| dotnet: 8.0 | |
| - os: | |
| name: 🐧 | |
| runs-on: ubuntu-22.04-arm | |
| arch: arm64 | |
| runtime: linux-arm64 | |
| platform: linux/arm64/v8 | |
| dotnet: 9.0 | |
| # Windows x64 | |
| - os: | |
| name: 🪟 | |
| runs-on: windows-latest | |
| arch: x64 | |
| runtime: win-x64 | |
| platform: windows/amd64 | |
| dotnet: 8.0 | |
| - os: | |
| name: 🪟 | |
| runs-on: windows-latest | |
| arch: x64 | |
| runtime: win-x64 | |
| platform: windows/amd64 | |
| dotnet: 9.0 | |
| # Windows arm64 | |
| - os: | |
| name: 🪟 | |
| runs-on: windows-latest | |
| arch: arm64 | |
| runtime: win-arm64 | |
| platform: windows/arm64 | |
| dotnet: 8.0 | |
| - os: | |
| name: 🪟 | |
| runs-on: windows-latest | |
| arch: arm64 | |
| runtime: win-arm64 | |
| platform: windows/arm64 | |
| dotnet: 9.0 | |
| # macOS x64 | |
| - os: | |
| name: 🍎 | |
| runs-on: macos-15-intel | |
| arch: x64 | |
| runtime: osx-x64 | |
| platform: macos/amd64 | |
| dotnet: 8.0 | |
| - os: | |
| name: 🍎 | |
| runs-on: macos-15-intel | |
| arch: x64 | |
| runtime: osx-x64 | |
| platform: macos/amd64 | |
| dotnet: 9.0 | |
| # macOS arm64 | |
| - os: | |
| name: 🍎 | |
| runs-on: macos-15 | |
| arch: arm64 | |
| runtime: osx-arm64 | |
| platform: macos/arm64 | |
| dotnet: 8.0 | |
| - os: | |
| name: 🍎 | |
| runs-on: macos-15 | |
| arch: arm64 | |
| runtime: osx-arm64 | |
| platform: macos/arm64 | |
| dotnet: 9.0 | |
| steps: | |
| - name: Checkout source | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET SDK ${{ matrix.dotnet }} | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: ${{ matrix.dotnet }} | |
| - name: Setup .NET 9 (for ARM64 on .NET 8) | |
| if: matrix.runtime == 'linux-arm64' && matrix.arch == 'arm64' && matrix.dotnet == '8.0' | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 9.0 | |
| - name: Build & Test (${{ matrix.runtime }}) | |
| run: dotnet test Testing/Acceptance/GenHTTP.Testing.Acceptance.csproj -c Release -f net${{ matrix.dotnet }}.0 |