|
| 1 | +name: Verify Platform Support |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + pull_request: |
| 6 | + |
| 7 | +jobs: |
| 8 | + linux: |
| 9 | + name: Linux – ${{ matrix.arch }} (.NET ${{ matrix.dotnet-version }}) |
| 10 | + runs-on: ubuntu-latest |
| 11 | + |
| 12 | + strategy: |
| 13 | + fail-fast: false |
| 14 | + matrix: |
| 15 | + dotnet-version: [8.0.x, 9.0.x] |
| 16 | + include: |
| 17 | + - arch: x64 |
| 18 | + runtime: linux-x64 |
| 19 | + platform: linux/amd64 |
| 20 | + qemu: false |
| 21 | + - arch: arm32 |
| 22 | + runtime: linux-arm |
| 23 | + platform: linux/arm/v7 |
| 24 | + qemu: true |
| 25 | + - arch: arm64 |
| 26 | + runtime: linux-arm64 |
| 27 | + platform: linux/arm64/v8 |
| 28 | + qemu: true |
| 29 | + |
| 30 | + steps: |
| 31 | + - name: Checkout |
| 32 | + uses: actions/checkout@v4 |
| 33 | + |
| 34 | + - name: Setup .NET SDK ${{ matrix.dotnet-version }} |
| 35 | + uses: actions/setup-dotnet@v4 |
| 36 | + with: |
| 37 | + dotnet-version: ${{ matrix.dotnet-version }} |
| 38 | + |
| 39 | + - name: Setup QEMU |
| 40 | + if: ${{ matrix.qemu }} |
| 41 | + uses: docker/setup-qemu-action@v3 |
| 42 | + |
| 43 | + - name: Setup Docker Buildx |
| 44 | + if: ${{ matrix.qemu }} |
| 45 | + uses: docker/setup-buildx-action@v3 |
| 46 | + |
| 47 | + - name: Build & Test (${{ matrix.runtime }}) |
| 48 | + shell: bash |
| 49 | + run: | |
| 50 | + echo "=== Building and Testing for ${{ matrix.runtime }} (.NET ${{ matrix.dotnet-version }}) ===" |
| 51 | +
|
| 52 | + if [[ "${{ matrix.qemu }}" == "true" ]]; then |
| 53 | + docker run --rm \ |
| 54 | + --platform ${{ matrix.platform }} \ |
| 55 | + -v $PWD:/src -w /src \ |
| 56 | + mcr.microsoft.com/dotnet/sdk:${{ matrix.dotnet-version%.* }} \ |
| 57 | + bash -c "dotnet restore && dotnet build -c Release --runtime ${{ matrix.runtime }} && dotnet test -c Release --runtime ${{ matrix.runtime }} --no-build" |
| 58 | + else |
| 59 | + dotnet restore |
| 60 | + dotnet build -c Release --runtime ${{ matrix.runtime }} |
| 61 | + dotnet test -c Release --runtime ${{ matrix.runtime }} --no-build |
| 62 | + fi |
| 63 | +
|
| 64 | + windows: |
| 65 | + name: Windows – x64 (.NET ${{ matrix.dotnet-version }}) |
| 66 | + runs-on: windows-latest |
| 67 | + |
| 68 | + strategy: |
| 69 | + fail-fast: false |
| 70 | + matrix: |
| 71 | + dotnet-version: [8.0.x, 9.0.x] |
| 72 | + |
| 73 | + steps: |
| 74 | + - name: Checkout |
| 75 | + uses: actions/checkout@v4 |
| 76 | + |
| 77 | + - name: Setup .NET SDK ${{ matrix.dotnet-version }} |
| 78 | + uses: actions/setup-dotnet@v4 |
| 79 | + with: |
| 80 | + dotnet-version: ${{ matrix.dotnet-version }} |
| 81 | + |
| 82 | + - name: Build & Test (win-x64) |
| 83 | + shell: pwsh |
| 84 | + run: | |
| 85 | + Write-Host "=== Building and Testing for win-x64 (.NET ${{ matrix.dotnet-version }}) ===" |
| 86 | + dotnet restore |
| 87 | + dotnet build -c Release --runtime win-x64 |
| 88 | + dotnet test -c Release --runtime win-x64 --no-build |
0 commit comments