|
| 1 | +name: CI (Mac) |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - master |
| 6 | + - '*/*mac-build' |
| 7 | + |
| 8 | +jobs: |
| 9 | + build-mac-intel: |
| 10 | + name: Build on Mac x86_64-apple-darwin |
| 11 | + runs-on: macos-13 |
| 12 | + steps: |
| 13 | + - name: Checkout |
| 14 | + uses: actions/checkout@v3 |
| 15 | + with: |
| 16 | + ref: ${{ inputs.tag || env.GITHUB_REF }} |
| 17 | + |
| 18 | + - name: Create Mac Build Environment |
| 19 | + run: brew install cmake ninja llvm@16 |
| 20 | + |
| 21 | + - name: Compile Barretenberg |
| 22 | + working-directory: barretenberg/cpp |
| 23 | + run: | |
| 24 | + export PATH="/usr/local/opt/llvm@16/bin:$PATH" |
| 25 | + export LDFLAGS="-L/usr/local/opt/llvm@16/lib" |
| 26 | + export CPPFLAGS="-I/usr/local/opt/llvm@16/include" |
| 27 | + cmake -DCMAKE_BUILD_TYPE=RelWithAssert --preset default |
| 28 | + cmake --build --preset default --target bb |
| 29 | +
|
| 30 | + build-mac-m1: |
| 31 | + name: Build on Mac aarch64-apple-darwin |
| 32 | + runs-on: macos-14 |
| 33 | + steps: |
| 34 | + - name: Checkout |
| 35 | + uses: actions/checkout@v3 |
| 36 | + with: |
| 37 | + ref: ${{ inputs.tag || env.GITHUB_REF }} |
| 38 | + |
| 39 | + - name: Create Mac Build Environment |
| 40 | + run: brew install cmake ninja |
| 41 | + |
| 42 | + - name: Compile Barretenberg |
| 43 | + working-directory: barretenberg/cpp |
| 44 | + run: | |
| 45 | + cmake --preset default -DCMAKE_BUILD_TYPE=RelWithAssert |
| 46 | + cmake --build --preset default --target bb |
| 47 | +
|
| 48 | + build-check: |
| 49 | + name: Check builds are successful |
| 50 | + needs: [build-mac-intel, build-mac-m1] |
| 51 | + if: ${{ always() }} |
| 52 | + runs-on: ubuntu-latest |
| 53 | + steps: |
| 54 | + - name: Report overall success |
| 55 | + env: |
| 56 | + FAIL: ${{ contains(needs.*.result, 'failure') }} |
| 57 | + run: | |
| 58 | + if [[ $FAIL == true ]]; then |
| 59 | + echo "At least one job failed, release is unsuccessful." |
| 60 | + exit 1 |
| 61 | + else |
| 62 | + echo "All jobs succeeded, uploading artifacts to release." |
| 63 | + exit 0 |
| 64 | + fi |
| 65 | +
|
| 66 | + - name: Send notification to aztec3-ci channel if workflow failed on master |
| 67 | + if: ${{ failure() }} |
| 68 | + uses: slackapi/slack-github-action@v1.25.0 |
| 69 | + with: |
| 70 | + payload: | |
| 71 | + { |
| 72 | + "url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" |
| 73 | + } |
| 74 | + env: |
| 75 | + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_NOTIFY_WORKFLOW_TRIGGER_URL }} |
0 commit comments