Skip to content

Commit a08f01c

Browse files
filzrevtimcassell
andauthored
chore: Modify macos runner image for CI (#2775)
* chore: modify runner image for macos * chore: fix workflow name and artifact name * Update .github/workflows/run-tests.yaml --------- Co-authored-by: Tim Cassell <[email protected]>
1 parent 6730bf1 commit a08f01c

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

.github/workflows/run-tests.yaml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,25 @@ jobs:
9191
path: "**/*.trx"
9292

9393
test-macos:
94-
runs-on: macos-15
94+
name: test-macos (${{ matrix.os.arch }})
95+
runs-on: ${{ matrix.os.runs-on }}
96+
strategy:
97+
matrix:
98+
os:
99+
- runs-on: 'macos-latest'
100+
jsvu-os: 'mac64arm'
101+
arch: 'arm64'
102+
- runs-on: 'macos-13'
103+
jsvu-os: 'mac64'
104+
arch: 'x64'
95105
steps:
96106
- uses: actions/checkout@v4
97107
- name: Set up node
98108
uses: actions/setup-node@v4
99109
with:
100110
node-version: "22"
101111
- name: Set up v8
102-
run: npm install jsvu -g && jsvu --os=mac64 --engines=v8 && echo "$HOME/.jsvu/bin" >> $GITHUB_PATH
112+
run: npm install jsvu -g && jsvu --os=${{ matrix.os.jsvu-os }} --engines=v8 && echo "$HOME/.jsvu/bin" >> $GITHUB_PATH
103113
- name: Install wasm-tools workload
104114
run: ./build.cmd install-wasm-tools
105115
# Build and Test
@@ -114,7 +124,7 @@ jobs:
114124
uses: actions/upload-artifact@v4
115125
if: always()
116126
with:
117-
name: test-macos-trx-${{ github.run_id }}
127+
name: test-macos(${{ matrix.os.arch }})-trx-${{ github.run_id }}
118128
path: "**/*.trx"
119129

120130
test-pack:

build/BenchmarkDotNet.Build/Runners/UnitTestRunner.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using Cake.Common.Tools.DotNet;
55
using Cake.Common.Tools.DotNet.Test;
66
using Cake.Core.IO;
7+
using System.Runtime.InteropServices;
78

89
namespace BenchmarkDotNet.Build.Runners;
910

@@ -47,7 +48,8 @@ private DotNetTestSettings GetTestSettingsParameters(FilePath logFile, string tf
4748
private void RunTests(FilePath projectFile, string alias, string tfm)
4849
{
4950
var os = Utils.GetOs();
50-
var trxFileName = $"{os}-{alias}-{tfm}.trx";
51+
var arch = RuntimeInformation.OSArchitecture.ToString().ToLower();
52+
var trxFileName = $"{os}({arch})-{alias}-{tfm}.trx";
5153
var trxFile = TestOutputDirectory.CombineWithFilePath(trxFileName);
5254
var settings = GetTestSettingsParameters(trxFile, tfm);
5355

0 commit comments

Comments
 (0)