Specify the solution #9
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: Verify Platform Support | |
| on: | |
| push: | |
| branches: [ feature/multi-platform ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| linux: | |
| name: Linux – ${{ matrix.arch }} (.NET ${{ matrix.dotnet }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| dotnet: [8.0, 9.0] | |
| include: | |
| - arch: x64 | |
| runtime: linux-x64 | |
| platform: linux/amd64 | |
| qemu: false | |
| - arch: arm32 | |
| runtime: linux-arm | |
| platform: linux/arm/v7 | |
| qemu: true | |
| - arch: arm64 | |
| runtime: linux-arm64 | |
| platform: linux/arm64/v8 | |
| qemu: true | |
| 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 QEMU | |
| if: ${{ matrix.qemu }} | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Setup Docker Buildx | |
| if: ${{ matrix.qemu }} | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build and Test (${{ matrix.runtime }}) | |
| shell: bash | |
| run: | | |
| echo "=== Building and Testing for ${{ matrix.runtime }} (.NET ${{ matrix.dotnet }}) ===" | |
| if [[ "${{ matrix.qemu }}" == "true" ]]; then | |
| version="${{ matrix.dotnet }}" | |
| base_version="${version%.*}" | |
| docker run --rm \ | |
| --platform ${{ matrix.platform }} \ | |
| -v $PWD:/src -w /src \ | |
| mcr.microsoft.com/dotnet/sdk:$base_version \ | |
| bash -c "dotnet restore GenHTTP.slnx && dotnet build GenHTTP.slnx -c Release --runtime ${{ matrix.runtime }} && dotnet test GenHTTP.slnx -c Release --runtime ${{ matrix.runtime }} --no-build" | |
| else | |
| dotnet restore GenHTTP.slnx | |
| dotnet build GenHTTP.slnx -c Release --runtime ${{ matrix.runtime }} | |
| dotnet test GenHTTP.slnx -c Release --runtime ${{ matrix.runtime }} --no-build | |
| fi | |
| windows: | |
| name: Windows – x64 (.NET ${{ matrix.dotnet }}) | |
| runs-on: windows-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| dotnet: [8.0, 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: Build and Test (win-x64) | |
| shell: pwsh | |
| run: | | |
| Write-Host "=== Building and Testing for win-x64 (.NET ${{ matrix.dotnet }}) ===" | |
| dotnet restore GenHTTP.slnx | |
| dotnet build GenHTTP.slnx -c Release --runtime win-x64 | |
| dotnet test GenHTTP.slnx -c Release --runtime win-x64 --no-build |