Apple local development build #3
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: PR Tests - macOS | |
| on: | |
| pull_request: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.runner }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # macos-latest is Apple Silicon (osx-arm64); macos-13 is Intel (osx-x64). | |
| runner: [ macos-latest, macos-13 ] | |
| include: | |
| - dotnet-version: 6.0 | |
| tfm: net6.0 | |
| - dotnet-version: 7.0 | |
| tfm: net7.0 | |
| - dotnet-version: 8.0 | |
| tfm: net8.0 | |
| - dotnet-version: 9.0 | |
| tfm: net9.0 | |
| - dotnet-version: 10.0 | |
| tfm: net10.0 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: | | |
| 6.0.x | |
| 7.0.x | |
| 8.0.x | |
| 9.0.x | |
| 10.0.x | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Build Rust native (macOS) | |
| working-directory: cas-core-lib | |
| run: cargo build --release | |
| - name: Stage native lib for tests | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| OUTDIR="cas-dotnet-sdk-tests/bin/Release/${{ matrix.tfm }}" | |
| mkdir -p "$OUTDIR" | |
| cp "cas-core-lib/target/release/libcas_core_lib.dylib" "$OUTDIR/" | |
| ls -la "$OUTDIR" | |
| - name: Run tests (override framework) | |
| run: | | |
| echo "Running tests for framework ${{ matrix.tfm }} on ${{ matrix.runner }}" | |
| dotnet test ./cas-dotnet-sdk-tests/cas-dotnet-sdk-tests.csproj -c Release -f ${{ matrix.tfm }} --logger "trx" |