Skip to content

Commit eba8775

Browse files
committed
mac os tests
1 parent 2035d7d commit eba8775

2 files changed

Lines changed: 60 additions & 21 deletions

File tree

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,18 @@
1-
name: PR Tests - macOS
1+
name: PR Tests - macOS arm64
22

33
on:
44
pull_request:
55
branches: [ main ]
66
workflow_dispatch:
77

8-
permissions:
9-
contents: read
10-
118
concurrency:
129
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
1310
cancel-in-progress: true
1411

1512
jobs:
1613
build:
14+
# macos-latest is Apple Silicon (osx-arm64).
1715
runs-on: macos-latest
18-
strategy:
19-
matrix:
20-
include:
21-
- dotnet-version: 6.0
22-
tfm: net6.0
23-
- dotnet-version: 7.0
24-
tfm: net7.0
25-
- dotnet-version: 8.0
26-
tfm: net8.0
27-
- dotnet-version: 9.0
28-
tfm: net9.0
29-
- dotnet-version: 10.0
30-
tfm: net10.0
3116

3217
steps:
3318
- name: Checkout repository
@@ -48,7 +33,7 @@ jobs:
4833
- name: Setup Rust
4934
uses: dtolnay/rust-toolchain@stable
5035

51-
- name: Build Rust native (macOS)
36+
- name: Build Rust native (macOS arm64)
5237
working-directory: cas-core-lib
5338
run: cargo build --release
5439

@@ -57,13 +42,13 @@ jobs:
5742
run: |
5843
set -euo pipefail
5944
for tfm in net6.0 net7.0 net8.0 net9.0 net10.0; do
60-
OUTDIR="cas-dotnet-sdk-tests/bin/Release/${{ matrix.tfm }}"
45+
OUTDIR="cas-dotnet-sdk-tests/bin/Release/${tfm}"
6146
mkdir -p "$OUTDIR"
6247
cp "cas-core-lib/target/release/libcas_core_lib.dylib" "$OUTDIR/"
6348
done
6449
ls -la cas-dotnet-sdk-tests/bin/Release
6550
6651
- name: Run tests (all target frameworks)
6752
run: |
68-
echo "Running tests for framework ${{ matrix.tfm }}"
69-
dotnet test ./cas-dotnet-sdk-tests/cas-dotnet-sdk-tests.csproj -c Release -f ${{ matrix.tfm }} --logger "trx"
53+
echo "Running tests for all target frameworks on macos-latest (arm64)"
54+
dotnet test ./cas-dotnet-sdk-tests/cas-dotnet-sdk-tests.csproj -c Release --logger "trx"
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: PR Tests - macOS x64
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
workflow_dispatch:
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
build:
14+
# macos-13 is Intel (osx-x64).
15+
runs-on: macos-13
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
with:
21+
submodules: recursive
22+
23+
- name: Setup .NET
24+
uses: actions/setup-dotnet@v4
25+
with:
26+
dotnet-version: |
27+
6.0.x
28+
7.0.x
29+
8.0.x
30+
9.0.x
31+
10.0.x
32+
33+
- name: Setup Rust
34+
uses: dtolnay/rust-toolchain@stable
35+
36+
- name: Build Rust native (macOS x64)
37+
working-directory: cas-core-lib
38+
run: cargo build --release
39+
40+
- name: Stage native lib for tests
41+
shell: bash
42+
run: |
43+
set -euo pipefail
44+
for tfm in net6.0 net7.0 net8.0 net9.0 net10.0; do
45+
OUTDIR="cas-dotnet-sdk-tests/bin/Release/${tfm}"
46+
mkdir -p "$OUTDIR"
47+
cp "cas-core-lib/target/release/libcas_core_lib.dylib" "$OUTDIR/"
48+
done
49+
ls -la cas-dotnet-sdk-tests/bin/Release
50+
51+
- name: Run tests (all target frameworks)
52+
run: |
53+
echo "Running tests for all target frameworks on macos-13 (x64)"
54+
dotnet test ./cas-dotnet-sdk-tests/cas-dotnet-sdk-tests.csproj -c Release --logger "trx"

0 commit comments

Comments
 (0)