Skip to content

Commit

Permalink
fix(CI): Add Mac-arm64 to build matrix (#1359)
Browse files Browse the repository at this point in the history
Support for this came out in January, 2024. Explicit macos versions seem
to be necessary for now, until GitHub offers "latest" labels targeting
specific architectures.
  • Loading branch information
joeyparrish authored Mar 4, 2024
1 parent 9c033b9 commit c456ad6
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/build-matrix.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,21 @@
"generator": "Ninja"
},
{
"os": "macos-latest",
"comment": "Explicit macOS version 13 is required for explicit x64 CPU.",
"os": "macos-13",
"os_name": "osx",
"target_arch": "x64",
"exe_ext": "",
"generator": "Ninja"
},
{
"comment": "Explicit macOS version 14 is required for explicit arm64 CPU.",
"os": "macos-14",
"os_name": "osx",
"target_arch": "arm64",
"exe_ext": "",
"generator": "Ninja"
},
{
"os": "windows-latest",
"os_name": "win",
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,28 @@ jobs:
run: |
brew install ninja
- name: Check Mac CPU architecture
if: runner.os == 'macOS'
# In case we get confused about GitHub's mac VM image labels,
# explicitly check that the CPU type matches our expectations.
run: |
if [[ "${{matrix.target_arch}}" == "arm64" ]]; then
CORRECT_LABEL="arm64"
else
CORRECT_LABEL="x86_64"
fi
LABEL=$(uname -m)
echo "Hardware label: \"$LABEL\""
if [[ "$LABEL" != "$CORRECT_LABEL" ]]; then
echo "Wrong hardware label \"$LABEL\", expecting \"$CORRECT_LABEL\"."
echo "Full uname string: $(uname -a)"
echo "Full sysctl CPU info:"
sysctl machdep.cpu
exit 1
fi
- name: Generate build files
run: |
mkdir -p build/
Expand Down

0 comments on commit c456ad6

Please sign in to comment.