Apple local development build #4
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: macos-latest | |
| strategy: | |
| matrix: | |
| 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 | |
| for tfm in net6.0 net7.0 net8.0 net9.0 net10.0; do | |
| OUTDIR="cas-dotnet-sdk-tests/bin/Release/${{ matrix.tfm }}" | |
| mkdir -p "$OUTDIR" | |
| cp "cas-core-lib/target/release/libcas_core_lib.dylib" "$OUTDIR/" | |
| done | |
| ls -la cas-dotnet-sdk-tests/bin/Release | |
| - name: Run tests (all target frameworks) | |
| run: | | |
| echo "Running tests for framework ${{ matrix.tfm }}" | |
| dotnet test ./cas-dotnet-sdk-tests/cas-dotnet-sdk-tests.csproj -c Release -f ${{ matrix.tfm }} --logger "trx" |