Skip to content

Commit

Permalink
ci: run macOS builds on both arm64 and x86_64
Browse files Browse the repository at this point in the history
The macos-latest runner image has historically been x86_64, but it's
currently migrating from macos-12 to macos-14 which runs on arm64
hardware.  It seems useful to get test coverage on both architectures, so
arrange that for now.  Presumably we'll eventually have to drop macOS
x86_64 tests when the macos-12 image goes out of support.

Homebrew installs into /opt/homebrew on arm64 Macs.
  • Loading branch information
bgilbert authored and neheb committed Apr 11, 2024
1 parent 4c139ba commit 0cdd746
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/build_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,13 @@ jobs:
MacOS:
if: github.event_name != 'schedule' || github.repository == 'mesonbuild/wrapdb'
runs-on: macos-latest
runs-on: ${{ matrix.platform == 'arm64' && 'macos-14' || 'macos-12' }}
env:
TEST_BUILD_ALL: 1
TEST_FATAL_WARNINGS: ${{ github.event.inputs.fatal_warnings }}
strategy:
matrix:
platform: ['arm64', 'x86_64']
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -158,11 +161,11 @@ jobs:
# github actions overwrites brew's python. Force it to reassert itself, by running in a separate step.
- name: unbreak python in github actions
run: |
find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete
find $(brew --prefix)/bin -lname '*/Library/Frameworks/Python.framework/*' -delete
sudo rm -rf /Library/Frameworks/Python.framework/
brew install --force python3 && brew unlink python3 && brew unlink python3 && brew link --overwrite python3
# Work around PEP 668 nonsense…
find /usr/local/Cellar/python* -name EXTERNALLY-MANAGED -print0 | xargs -0 rm -vf
find $(brew --prefix)/Cellar/python* -name EXTERNALLY-MANAGED -print0 | xargs -0 rm -vf
- name: Install packages
run: |
brew install ninja
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/sanity_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,10 @@ jobs:
python tools/sanity_checks.py
MacOS:
runs-on: macos-latest
runs-on: ${{ matrix.platform == 'arm64' && 'macos-14' || 'macos-12' }}
strategy:
matrix:
platform: ['arm64', 'x86_64']
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -140,11 +143,11 @@ jobs:
# github actions overwrites brew's python. Force it to reassert itself, by running in a separate step.
- name: unbreak python in github actions
run: |
find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete
find $(brew --prefix)/bin -lname '*/Library/Frameworks/Python.framework/*' -delete
sudo rm -rf /Library/Frameworks/Python.framework/
brew install --force python3 && brew unlink python3 && brew unlink python3 && brew link --overwrite python3
# Work around PEP 668 nonsense…
find /usr/local/Cellar/python* -name EXTERNALLY-MANAGED -print0 | xargs -0 rm -vf
find $(brew --prefix)/Cellar/python* -name EXTERNALLY-MANAGED -print0 | xargs -0 rm -vf
- name: Install packages
run: |
brew install ninja
Expand Down

0 comments on commit 0cdd746

Please sign in to comment.