Run the CI build/test matrix on Linux, Windows, and macOS (#17) #73
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: CI | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - 'feature/**' | |
| pull_request: | |
| branches: | |
| - master | |
| jobs: | |
| build: | |
| strategy: | |
| # Each OS leg is an independent support claim; let the others finish so a | |
| # failure reports exactly which platforms are broken. | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| global-json-file: global.json | |
| - name: Restore | |
| run: dotnet restore | |
| - name: Verify formatting | |
| # Formatting is source-level and OS-independent; checking once avoids | |
| # line-ending false positives on Windows checkouts. | |
| if: matrix.os == 'ubuntu-latest' | |
| run: dotnet format --verify-no-changes | |
| - name: Build | |
| run: dotnet build --configuration Release --no-restore | |
| - name: Test | |
| run: dotnet test --configuration Release --no-build | |
| env: | |
| # The container-backed integration fixtures skip when Docker is | |
| # unavailable but fail hard when CI=true. Only the Linux runners can | |
| # run the Linux database containers Testcontainers needs, so they | |
| # keep the fail-hard guard; on Windows/macOS the override lets those | |
| # fixtures skip while every other test still runs. | |
| CI: ${{ matrix.os == 'ubuntu-latest' && 'true' || 'false' }} | |
| - name: Pack | |
| run: dotnet pack --configuration Release --no-build --output artifacts | |
| - name: Upload NuGet artifacts | |
| # Packages are OS-independent; one leg uploads (v4 artifact names must | |
| # be unique across a matrix). Pack itself still runs on every OS so | |
| # platform-specific packaging bugs surface. | |
| if: matrix.os == 'ubuntu-latest' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: nuget-packages | |
| path: artifacts/*.nupkg | |
| aot-smoke-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| global-json-file: global.json | |
| - name: Publish Native AOT smoke test | |
| run: dotnet publish test/SqlBound.AotSmokeTest --configuration Release --runtime linux-x64 | |
| - name: Run Native AOT smoke test | |
| run: ./test/SqlBound.AotSmokeTest/bin/Release/net10.0/linux-x64/publish/SqlBound.AotSmokeTest |