Skip to content

Add multi-platform tests to verify compatibility #15

Add multi-platform tests to verify compatibility

Add multi-platform tests to verify compatibility #15

Workflow file for this run

name: Verify Platform Support
on:
pull_request:
branches: [ main ]
jobs:
linux:
name: Linux – ${{ matrix.arch.name }} (.NET ${{ matrix.dotnet }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
dotnet: [8.0, 9.0]
arch:
- name: x64
runtime: linux-x64
platform: linux/amd64
qemu: false
- name: arm32
runtime: linux-arm
platform: linux/arm/v7
qemu: true
- name: 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.arch.qemu }}
uses: docker/setup-qemu-action@v3
- name: Setup Docker Buildx
if: ${{ matrix.arch.qemu }}
uses: docker/setup-buildx-action@v3
- name: Build and Test (${{ matrix.arch.runtime }})
shell: bash
run: |
echo "=== Building and Testing for ${{ matrix.arch.runtime }} (.NET ${{ matrix.dotnet }}) ==="
if [[ "${{ matrix.arch.qemu }}" == "true" ]]; then
docker run --rm \
--platform ${{ matrix.arch.platform }} \
-v $PWD:/src -w /src \
mcr.microsoft.com/dotnet/sdk:${{ matrix.dotnet }}.0 \
bash -c "dotnet test Testing/Acceptance/GenHTTP.Testing.Acceptance.csproj -c Release -p:TargetFramework=net${{ matrix.dotnet }}.0"
else
dotnet test Testing/Acceptance/GenHTTP.Testing.Acceptance.csproj -c Release -p:TargetFramework=net${{ matrix.dotnet }}.0
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 test Testing/Acceptance/GenHTTP.Testing.Acceptance.csproj -c Release -p:TargetFramework=net${{ matrix.dotnet }}.0