Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(CI): Add Mac-arm64 to build matrix #1359

Merged
merged 4 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading