Skip to content

Commit

Permalink
Use aarch64 macOS agent for CI build (#2754)
Browse files Browse the repository at this point in the history
This PR updates the macOS CI build to use the `macos-14` build agent.
This uses the M series aarch64 chips.

* The M1 macOS agent does not have stack preinstalled so we must install
it using brew before building anything.
* The cache keys must have the `runner.arch` prefix to avoid building
with the x86_64 cache.

The macOS build / test run in about the same time as the linux build /
test, i.e significantly faster than on the x86 macOS agents.

## Notes

* We use the x86_64 binary of vamp-ir because the vamp-ir aarch64
releases do not have names that are compatible with the GitHub action we
are using to download the binary releases. The x86_64 binary works fine
for the purposes of testing.
  • Loading branch information
paulcadman authored Apr 25, 2024
1 parent f5c25bf commit 778b626
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ jobs:
make smoke-only
build-and-test-macos:
runs-on: macos-12
runs-on: macos-14
steps:
- uses: extractions/setup-just@v2

Expand All @@ -238,6 +238,10 @@ jobs:
path: main
submodules: true

- name: install stack
run: |
brew install haskell-stack
- name: Install Sed
run: |
brew install gnu-sed
Expand Down Expand Up @@ -268,7 +272,7 @@ jobs:
echo "WASI_SYSROOT_PATH=$GITHUB_WORKSPACE/wasi-sysroot" >> $GITHUB_ENV
- name: Install the latest Wasmer version
uses: jaxxstorm/action-install-gh-release@v1.10.0
uses: jaxxstorm/action-install-gh-release@v1.11.0
with:
repo: wasmerio/wasmer
binaries-location: bin
Expand Down Expand Up @@ -310,7 +314,7 @@ jobs:
test: false
stack-arguments: --copy-bins
working-directory: smoke-repo
cache-prefix: ${{ steps.icuversion.outputs.version }}
cache-prefix: ${{ runner.arch }}-${{ steps.icuversion.outputs.version }}
pedantic: false

- name: Set homebrew LLVM CC and LIBTOOL vars (macOS)
Expand All @@ -331,7 +335,7 @@ jobs:
uses: actions/cache@v4
with:
path: ${{ env.HOME }}/.local/bin/juvix-cairo-vm
key: ${{ runner.os }}-cairo-vm-${{ env.CAIRO_VM_VERSION }}
key: ${{ runner.os }}-${{ runner.arch }}-cairo-vm-${{ env.CAIRO_VM_VERSION }}

- name: Install Rust toolchain
if: steps.cache-cairo-vm.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -375,7 +379,7 @@ jobs:
uses: actions/cache@v3
with:
path: main/.hie
key: ${{ runner.os }}-stack-hie
key: ${{ runner.os }}-${{ runner.arch }}-stack-hie

- name: Stack setup
id: stack
Expand All @@ -384,16 +388,18 @@ jobs:
working-directory: main
stack-build-arguments: ${{ env.STACK_BUILD_ARGS }}
test: false
cache-prefix: ${{ runner.arch }}

- name: Add homebrew clang to the PATH (macOS)
run: |
echo "$(brew --prefix llvm@15)/bin" >> $GITHUB_PATH
- name: Install VampIR for testing
uses: jaxxstorm/action-install-gh-release@v1.10.0
uses: jaxxstorm/action-install-gh-release@v1.11.0
with:
repo: ${{ env.VAMPIRREPO }}
platform: darwin
arch: x86_64
tag: ${{ env.VAMPIRVERSION }}
chmod: 0755
rename-to: vamp-ir
Expand Down

0 comments on commit 778b626

Please sign in to comment.