-
Notifications
You must be signed in to change notification settings - Fork 310
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
20d7576
commit 98ccfea
Showing
2 changed files
with
128 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |