Skip to content

Commit 3374796

Browse files
authored
Fix GitHub Actions job failures (#682)
* Update GitHub Actions to more recent versions This should fix the error "Could not find '.NET Core SDK' with version = 2.1.818" thrown by `dotnet_install` during GitHub Actions (CI). * Run MacOS build & test on non-ARM architecture This should fix the "Could not find 'dotnet' host for the 'X64' archi- tecture" error.
1 parent a3e629b commit 3374796

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

Diff for: .github/workflows/build.yml

+13-6
Original file line numberDiff line numberDiff line change
@@ -12,38 +12,45 @@ jobs:
1212

1313
strategy:
1414
matrix:
15-
os: [ ubuntu-latest, windows-latest, macos-latest ]
15+
os: [ ubuntu-latest, windows-latest, macos-13 ]
16+
17+
# NOTE: If we wanted to use `macos-latest` we would have to move the .NET Core 2.1 and 3.1 builds and test runs
18+
# to a separate job. This is because `macos-14` and newer are ARM-only and those target frameworks don't support
19+
# that architecture, causing `dotnet` to want to fall back to X64. However, once we install .NET 6 or newer,
20+
# we get a toolchain that only has ARM support and no X64 support, so that fallback will no longer work.
21+
# Using `macos-13` is (for the time being, while still available) the simpler solution as it is not ARM-based yet,
22+
# so there won't be any architecture mismatch in the first place.
1623

1724
runs-on: ${{ matrix.os }}
1825

1926
steps:
2027

2128
- name: Checkout repository
22-
uses: actions/checkout@v2
29+
uses: actions/checkout@v4
2330

2431
# Several .NET Core versions will be used during the test run.
2532
# The lowest version gets installed first in order to prevent
2633
# "a newer version is already installed" install errors.
2734

2835
- name: Install .NET Core 2.1
29-
uses: actions/setup-dotnet@v1
36+
uses: actions/setup-dotnet@v4
3037
with:
3138
dotnet-version: 2.1.x
3239

3340
- name: Install .NET Core 3.1
34-
uses: actions/setup-dotnet@v1
41+
uses: actions/setup-dotnet@v4
3542
with:
3643
dotnet-version: 3.1.x
3744

3845
- name: Install .NET 6.0
39-
uses: actions/setup-dotnet@v1
46+
uses: actions/setup-dotnet@v4
4047
with:
4148
dotnet-version: 6.0.x
4249

4350
# Building requires an up-to-date .NET SDK.
4451

4552
- name: Install .NET 7.0
46-
uses: actions/setup-dotnet@v1
53+
uses: actions/setup-dotnet@v4
4754
with:
4855
dotnet-version: 7.0.x
4956

0 commit comments

Comments
 (0)