Skip to content

Commit

Permalink
chore(ci): don't run on draft PRs (#8426)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludamad authored Sep 6, 2024
1 parent dd09b76 commit 8abe6c8
Showing 1 changed file with 33 additions and 31 deletions.
64 changes: 33 additions & 31 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ env:

jobs:
setup:
if: github.event.pull_request.draft == false
uses: ./.github/workflows/setup-runner.yml
with:
username: ${{ github.event.pull_request.user.login || github.actor }}
Expand All @@ -36,6 +37,7 @@ jobs:

changes:
runs-on: ubuntu-20.04
if: github.event.pull_request.draft == false
# Required permissions.
permissions:
pull-requests: read
Expand Down Expand Up @@ -92,21 +94,21 @@ jobs:
runs-on: ${{ github.event.pull_request.user.login || github.actor }}-x86
steps:
- uses: actions/checkout@v4
if: ${{ needs.changes.outputs.build-images == 'true' }}
if: needs.changes.outputs.build-images == 'true'
with: { ref: "${{ env.GIT_COMMIT }}" }
- uses: ./.github/ci-setup-action
if: ${{ needs.changes.outputs.build-images == 'true' }}
if: needs.changes.outputs.build-images == 'true'
with:
concurrency_key: build-images-x86
- name: "Push Build Images If Changed"
if: ${{ needs.changes.outputs.build-images == 'true' }}
if: needs.changes.outputs.build-images == 'true'
timeout-minutes: 40
run: |
earthly-ci --push ./build-images/+build
build:
needs: [build-images, changes]
if: ${{ needs.changes.outputs.non-docs == 'true' && needs.changes.outputs.non-misc-ci == 'true' && needs.changes.outputs.non-barretenberg-cpp == 'true' }}
if: needs.changes.outputs.non-docs == 'true' && needs.changes.outputs.non-misc-ci == 'true' && needs.changes.outputs.non-barretenberg-cpp == 'true'
runs-on: ${{ github.event.pull_request.user.login || github.actor }}-x86
outputs:
e2e_list: ${{ steps.e2e_list.outputs.list }}
Expand Down Expand Up @@ -134,7 +136,7 @@ jobs:
# all the non-bench end-to-end integration tests for aztec
e2e:
needs: [build, changes]
if: ${{ needs.changes.outputs.non-barretenberg-cpp == 'true' }}
if: needs.changes.outputs.non-barretenberg-cpp == 'true'
runs-on: ubuntu-20.04
strategy:
fail-fast: false
Expand Down Expand Up @@ -164,7 +166,7 @@ jobs:
# all the benchmarking end-to-end integration tests for aztec (not required to merge)
bench-e2e:
needs: [build, changes]
if: ${{ needs.changes.outputs.non-barretenberg-cpp == 'true' }}
if: needs.changes.outputs.non-barretenberg-cpp == 'true'
runs-on: ubuntu-20.04
strategy:
fail-fast: false
Expand Down Expand Up @@ -197,7 +199,7 @@ jobs:
runs-on: ubuntu-20.04
needs: [build-images, changes]
# Note: not fully accurate, but to work with bench-summary needs to be the same as bench-e2e
if: ${{ needs.changes.outputs.non-barretenberg-cpp == 'true' }}
if: needs.changes.outputs.non-barretenberg-cpp == 'true'
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
Expand Down Expand Up @@ -239,7 +241,7 @@ jobs:
run: |
earthly-ci -P +bench-aggregate
- name: "Download base benchmark and package into earthly"
if: ${{ github.event_name == 'pull_request' }}
if: github.event_name == 'pull_request'
run: |
# Download the base benchmark locally (requires AWS creds and .git history)
mkdir -p $BENCH_FOLDER
Expand All @@ -252,7 +254,7 @@ jobs:
BENCH_FOLDER: "./scripts/logs/tmp/bench"
PULL_REQUEST: "${{ github.event.pull_request.number }}"
- name: "Generate summary comment if pull request"
if: ${{ github.event_name == 'pull_request' }}
if: github.event_name == 'pull_request'
working-directory: ./yarn-project/scripts
run: |
earthly-ci -P +bench-comment
Expand All @@ -262,7 +264,7 @@ jobs:
bb-gcc:
needs: [build-images, changes]
runs-on: ${{ github.event.pull_request.user.login || github.actor }}-x86
if: ${{ needs.changes.outputs.barretenberg-cpp == 'true' }}
if: needs.changes.outputs.barretenberg-cpp == 'true'
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
Expand All @@ -282,7 +284,7 @@ jobs:
bb-native-tests:
needs: [build-images, changes]
runs-on: ${{ github.event.pull_request.user.login || github.actor }}-x86
if: ${{ needs.changes.outputs.barretenberg-cpp == 'true' }}
if: needs.changes.outputs.barretenberg-cpp == 'true'
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
Expand All @@ -300,7 +302,7 @@ jobs:
bb-js-test:
needs: [build-images, changes]
runs-on: ${{ github.event.pull_request.user.login || github.actor }}-x86
if: ${{ needs.changes.outputs.barretenberg == 'true' }}
if: needs.changes.outputs.barretenberg == 'true'
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
Expand All @@ -315,7 +317,7 @@ jobs:
noir-build-acir-tests:
needs: [build-images, changes]
runs-on: ${{ github.event.pull_request.user.login || github.actor }}-x86
if: ${{ needs.changes.outputs.barretenberg == 'true' || needs.changes.outputs.noir == 'true' }}
if: needs.changes.outputs.barretenberg == 'true' || needs.changes.outputs.noir == 'true'
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
Expand All @@ -329,7 +331,7 @@ jobs:
bb-acir-tests-bb:
needs: [noir-build-acir-tests, changes]
runs-on: ${{ github.event.pull_request.user.login || github.actor }}-x86
if: ${{ needs.changes.outputs.barretenberg == 'true' || needs.changes.outputs.noir == 'true' }}
if: needs.changes.outputs.barretenberg == 'true' || needs.changes.outputs.noir == 'true'
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
Expand All @@ -344,7 +346,7 @@ jobs:
bb-acir-tests-sol:
needs: [noir-build-acir-tests, changes]
runs-on: ${{ github.event.pull_request.user.login || github.actor }}-x86
if: ${{ needs.changes.outputs.barretenberg == 'true' || needs.changes.outputs.noir == 'true' }}
if: needs.changes.outputs.barretenberg == 'true' || needs.changes.outputs.noir == 'true'
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
Expand All @@ -359,7 +361,7 @@ jobs:
bb-acir-tests-sol-honk:
needs: [noir-build-acir-tests, changes]
runs-on: ${{ github.event.pull_request.user.login || github.actor }}-x86
if: ${{ needs.changes.outputs.barretenberg == 'true' || needs.changes.outputs.noir == 'true' }}
if: needs.changes.outputs.barretenberg == 'true' || needs.changes.outputs.noir == 'true'
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
Expand All @@ -374,7 +376,7 @@ jobs:
bb-acir-tests-bb-js:
needs: [noir-build-acir-tests, changes]
runs-on: ${{ github.event.pull_request.user.login || github.actor }}-x86
if: ${{ needs.changes.outputs.barretenberg == 'true' || needs.changes.outputs.noir == 'true' }}
if: needs.changes.outputs.barretenberg == 'true' || needs.changes.outputs.noir == 'true'
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
Expand All @@ -389,7 +391,7 @@ jobs:
noir-format:
needs: [build-images, changes]
runs-on: ${{ github.event.pull_request.user.login || github.actor }}-x86
if: ${{ needs.changes.outputs.noir == 'true' || needs.changes.outputs.noir-projects == 'true' }}
if: needs.changes.outputs.noir == 'true' || needs.changes.outputs.noir-projects == 'true'
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
Expand All @@ -409,7 +411,7 @@ jobs:
noir-test:
needs: [build-images, changes]
runs-on: ${{ github.event.pull_request.user.login || github.actor }}-x86
if: ${{ needs.changes.outputs.noir == 'true' }}
if: needs.changes.outputs.noir == 'true'
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
Expand All @@ -422,7 +424,7 @@ jobs:
noir-examples:
needs: [build-images, changes]
runs-on: ${{ github.event.pull_request.user.login || github.actor }}-x86
if: ${{ needs.changes.outputs.barretenberg == 'true' || needs.changes.outputs.noir == 'true' }}
if: needs.changes.outputs.barretenberg == 'true' || needs.changes.outputs.noir == 'true'
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
Expand All @@ -435,7 +437,7 @@ jobs:
noir-packages-test:
needs: [build-images, changes]
runs-on: ${{ github.event.pull_request.user.login || github.actor }}-x86
if: ${{ needs.changes.outputs.barretenberg == 'true' || needs.changes.outputs.noir == 'true' }}
if: needs.changes.outputs.barretenberg == 'true' || needs.changes.outputs.noir == 'true'
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
Expand All @@ -449,7 +451,7 @@ jobs:
noir-projects:
needs: [build-images, changes, build]
runs-on: ${{ github.event.pull_request.user.login || github.actor }}-x86
if: ${{ needs.changes.outputs.barretenberg == 'true' || needs.changes.outputs.noir == 'true' || needs.changes.outputs.noir-projects == 'true' }}
if: needs.changes.outputs.barretenberg == 'true' || needs.changes.outputs.noir == 'true' || needs.changes.outputs.noir-projects == 'true'
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
Expand All @@ -464,7 +466,7 @@ jobs:
avm-format:
needs: [build-images, changes]
runs-on: ${{ github.event.pull_request.user.login || github.actor }}-x86
if: ${{ needs.changes.outputs.avm-transpiler == 'true' || needs.changes.outputs.noir == 'true' }}
if: needs.changes.outputs.avm-transpiler == 'true' || needs.changes.outputs.noir == 'true'
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
Expand Down Expand Up @@ -518,7 +520,7 @@ jobs:
l1-contracts-test:
needs: [build-images, changes]
runs-on: ${{ github.event.pull_request.user.login || github.actor }}-x86
if: ${{ needs.changes.outputs.l1-contracts == 'true' }}
if: needs.changes.outputs.l1-contracts == 'true'
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
Expand All @@ -531,7 +533,7 @@ jobs:
docs-preview:
needs: [build-images, changes]
runs-on: ${{ github.event.pull_request.user.login || github.actor }}-x86
if: ${{ needs.changes.outputs.non-barretenberg-cpp == 'true' }}
if: needs.changes.outputs.non-barretenberg-cpp == 'true'
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
Expand All @@ -551,7 +553,7 @@ jobs:
bb-bench:
runs-on: ubuntu-20.04
needs: [build-images, changes]
if: ${{ needs.changes.outputs.barretenberg-cpp == 'true' }}
if: needs.changes.outputs.barretenberg-cpp == 'true'
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
Expand Down Expand Up @@ -579,7 +581,7 @@ jobs:
# https://aztecprotocol.github.io/aztec-packages/dev/bench/ with new benchmark data.
# This also creates an alert if benchmarks exceed the threshold specified below.
- name: Store benchmark result
if: ${{ github.ref == 'refs/heads/master' }}
if: github.ref == 'refs/heads/master'
uses: benchmark-action/github-action-benchmark@4de1bed97a47495fc4c5404952da0499e31f5c29
with:
name: C++ Benchmark
Expand Down Expand Up @@ -635,7 +637,7 @@ jobs:

protocol-circuits-gates-report:
needs: [build-images, changes]
if: ${{ needs.changes.outputs.non-docs == 'true' && needs.changes.outputs.non-misc-ci == 'true' }}
if: needs.changes.outputs.non-docs == 'true' && needs.changes.outputs.non-misc-ci == 'true'
runs-on: ${{ github.event.pull_request.user.login || github.actor }}-x86
permissions:
pull-requests: write
Expand Down Expand Up @@ -703,7 +705,7 @@ jobs:
- boxes
- boxes-test
# - protocol-circuits-gates-report # non-blocking
if: always()
if: github.event.pull_request.draft == false && always()
steps:
- name: Report overall success
env:
Expand Down Expand Up @@ -754,7 +756,7 @@ jobs:
- boxes
- boxes-test
# - protocol-circuits-gates-report # non-blocking
if: ${{ !cancelled() }}
if: github.event.pull_request.draft == false && !cancelled()
steps:
- name: Check for Rerun
env:
Expand All @@ -773,7 +775,7 @@ jobs:
needs:
- merge-check
runs-on: ubuntu-20.04
if: ${{ github.ref == 'refs/heads/master' && failure() && github.run_attempt >= 2 }}
if: github.event.pull_request.draft == false && 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]
Expand Down

0 comments on commit 8abe6c8

Please sign in to comment.