Skip to content

Commit

Permalink
chore: run mac builds on master
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAFrench committed Sep 12, 2024
1 parent 20d7576 commit 98ccfea
Show file tree
Hide file tree
Showing 2 changed files with 128 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/ensure-builder/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ runs:
echo "runner_concurrency=20" >> $GITHUB_OUTPUT
echo "runner_label=$USERNAME-x86" >> $GITHUB_OUTPUT
echo "ttl=40" >> $GITHUB_OUTPUT
elif [[ $TYPE == builder-mac-x86 ]]; then
# 64-core ARM instance type
echo "instance_type=mac1.metal" >> $GITHUB_OUTPUT
echo "ami_id=?????" >> $GITHUB_OUTPUT
echo "ebs_cache_size=256" >> $GITHUB_OUTPUT
echo "runner_concurrency=8" >> $GITHUB_OUTPUT
echo "runner_label=$USERNAME-arm" >> $GITHUB_OUTPUT
echo "ttl=40" >> $GITHUB_OUTPUT
elif [[ $TYPE == builder-arm ]]; then
# 64-core ARM instance type
echo "instance_type=r6g.16xlarge" >> $GITHUB_OUTPUT
Expand Down
120 changes: 120 additions & 0 deletions .github/workflows/ci-mac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
name: CI (Mac)
on:
push:
branches:
- master
- '*/*mac-build'
workflow_dispatch:
inputs: {}
concurrency:
group: ci-master-mac
env:
RUN_ID: ${{ github.run_id }}
RUN_ATTEMPT: ${{ github.run_attempt }}
USERNAME: master
GITHUB_TOKEN: ${{ github.token }}
GH_SELF_HOSTED_RUNNER_TOKEN: ${{ secrets.GH_SELF_HOSTED_RUNNER_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
BUILD_INSTANCE_SSH_KEY: ${{ secrets.BUILD_INSTANCE_SSH_KEY }}
GIT_COMMIT: ${{ github.sha }}
# kludge until we move away from runners
WAIT_FOR_RUNNERS: false
jobs:
setup:
uses: ./.github/workflows/setup-runner.yml
with:
username: ${{ github.event.pull_request.user.login || github.actor }}
runner_type: builder-mac-x86
secrets: inherit

changes:
runs-on: ubuntu-20.04
# Required permissions.
permissions:
pull-requests: read
# Set job outputs to values from filter step
outputs:
barretenberg: ${{ steps.filter.outputs.barretenberg }}
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36
id: filter
with:
filters: |
barretenberg:
- 'barretenberg/**'
build:
needs: [changes]
if: needs.changes.outputs.barretenberg == 'true'
runs-on: ${{ github.event.pull_request.user.login || github.actor }}-arm
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- uses: ./.github/ci-setup-action
with:
concurrency_key: build-mac

- name: Install bleeding edge cmake
run: |
sudo apt -y remove --purge cmake
sudo snap install cmake --classic
- name: Create Build Environment
run: |
sudo apt-get update
sudo apt-get -y install ninja-build
- name: Install Clang16
run: |
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.0/clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz
tar -xvf clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz
sudo cp clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/* /usr/local/bin/
sudo cp -r clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/include/* /usr/local/include/
sudo cp -r clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/lib/* /usr/local/lib/
sudo cp -r clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/share/* /usr/local/share/
- name: Compile Barretenberg
run: |
cd barretenberg/cpp
cmake --preset default -DCMAKE_CXX_FLAGS="-stdlib=libc++" -DCMAKE_BUILD_TYPE=RelWithAssert -DTARGET_ARCH=westmere
cmake --build --preset default --target bb
rerun-check:
runs-on: ubuntu-20.04
permissions:
actions: write
needs: [setup, build]
if: ${{ !cancelled() }}
steps:
- name: Check for Rerun
env:
# We treat any skipped or failing jobs as a failure for the workflow as a whole.
HAD_FAILURE: ${{ contains(needs.*.result, 'failure') }}
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ github.token }}
run: |
if [[ $HAD_FAILURE == true ]] && [[ $RUN_ATTEMPT -lt 2 ]] ; then
echo "Retrying first workflow failure. This is a stop-gap until things are more stable."
gh workflow run rerun.yml -F run_id=${{ github.run_id }}
fi
# NOTE: we only notify failures after a rerun has occurred
notify:
needs: [build]
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/master' && failure() && github.run_attempt >= 2 }}
steps:
- name: Send notification to aztec3-ci channel if workflow failed on master
uses: slackapi/[email protected]
with:
payload: |
{
"url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_NOTIFY_WORKFLOW_TRIGGER_URL }}

0 comments on commit 98ccfea

Please sign in to comment.