Skip to content

Commit

Permalink
chore: merge queue CI (#10629)
Browse files Browse the repository at this point in the history
This should prevent 'bad stuff' from getting into master
  • Loading branch information
ludamad authored Dec 11, 2024
1 parent ecc037f commit 835e6fd
Showing 1 changed file with 69 additions and 51 deletions.
120 changes: 69 additions & 51 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
- master
- provernet
- "*/ci-push*"
merge_group:
pull_request:
types:
- opened
Expand All @@ -17,8 +18,8 @@ on:
inputs: {}

concurrency:
# force parallelism in master
group: ci-${{ github.ref_name == 'master' && github.run_id || github.ref_name }}
# allow parallelism in master and merge queue
group: ci-${{ (contains(github.ref_name, 'gh-readonly-queue') || github.ref_name == 'master') && github.run_id || github.ref_name }}
cancel-in-progress: true

env:
Expand Down Expand Up @@ -158,37 +159,62 @@ jobs:
# prepare images locally, tagged by commit hash
- name: "Build E2E Image"
timeout-minutes: 40
if: (needs.configure.outputs.non-docs == 'true' && needs.configure.outputs.non-barretenberg-cpp == 'true') || github.ref_name == 'master'
if: needs.configure.outputs.non-docs == 'true'
run: |
earthly-ci ./yarn-project+export-e2e-test-images
# We base our e2e list used in e2e-x86 off the targets in ./yarn-project/end-to-end
# (Note ARM uses just 2 tests as a smoketest)
- name: Create list of non-bench end-to-end jobs
id: e2e_list
env:
REF: contains(github.ref_name, 'gh-readonly-queue') && 'master' || github.ref_name
run: |
if [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then
LABELS=$(jq -r '.pull_request.labels | map(.name) | join(",")' "$GITHUB_EVENT_PATH")
else
LABELS=""
fi
echo Labels: $LABELS
echo "list=$(./scripts/ci/get_e2e_jobs.sh ${{github.ref_name}} "$LABELS")"
echo "list=$(./scripts/ci/get_e2e_jobs.sh ${{github.ref_name}} "$LABELS")" >> $GITHUB_OUTPUT
echo "list=$(./scripts/ci/get_e2e_jobs.sh $REF "$LABELS")"
echo "list=$(./scripts/ci/get_e2e_jobs.sh $REF "$LABELS")" >> $GITHUB_OUTPUT
- name: Create list of bench end-to-end jobs
id: bench_list
env:
REF: contains(github.ref_name, 'gh-readonly-queue') && 'master' || github.ref_name
run: |
if [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then
LABELS=$(jq -r '.pull_request.labels | map(.name) | join(",")' "$GITHUB_EVENT_PATH")
else
LABELS=""
fi
echo Labels: $LABELS
echo "list=$(./scripts/ci/get_bench_jobs.sh ${{github.ref_name}} "$LABELS")" >> $GITHUB_OUTPUT
echo "list=$(./scripts/ci/get_bench_jobs.sh $REF "$LABELS")"
echo "list=$(./scripts/ci/get_bench_jobs.sh $REF "$LABELS")" >> $GITHUB_OUTPUT
bench-test-gate:
needs: [build, configure]
if: contains(github.ref_name, 'gh-readonly-queue') || github.ref_name == 'master' || contains(github.event.pull_request.labels.*.name, 'bench-all')
runs-on: ubuntu-20.04
steps:
- run: "echo Full bench tests enabled."

e2e-test-gate:
needs: [build, configure]
if: contains(github.ref_name, 'gh-readonly-queue') || github.ref_name == 'master' || contains(github.event.pull_request.labels.*.name, 'e2e-all')
runs-on: ubuntu-20.04
steps:
- run: "echo Full E2E tests enabled."

network-test-gate:
needs: [build, configure]
if: github.ref_name == 'master' || contains(github.event.pull_request.labels.*.name, 'network-all')
runs-on: ubuntu-20.04
steps:
- run: "echo Full network tests enabled."

# all the non-bench end-to-end integration tests for aztec
e2e:
needs: [build, configure]
if: (needs.configure.outputs.non-docs == 'true' && needs.configure.outputs.non-barretenberg-cpp == 'true') || github.ref_name == 'master' || contains(github.event.pull_request.labels.*.name, 'e2e')
needs: [build, e2e-test-gate, configure]
if: needs.configure.outputs.non-docs == 'true'
runs-on: ubuntu-20.04
strategy:
fail-fast: false
Expand Down Expand Up @@ -222,8 +248,8 @@ jobs:
# all the benchmarking end-to-end integration tests for aztec (not required to merge)
bench-e2e:
needs: [build, configure]
if: needs.build.outputs.bench_list != '[]' && ((needs.configure.outputs.non-docs == 'true' && needs.configure.outputs.non-barretenberg-cpp == 'true') || github.ref_name == 'master' || contains(github.event.pull_request.labels.*.name, 'bench'))
needs: [build, bench-test-gate, configure]
if: needs.build.outputs.bench_list != '[]' && needs.configure.outputs.non-docs == 'true'
runs-on: ubuntu-20.04
strategy:
fail-fast: false
Expand Down Expand Up @@ -264,9 +290,7 @@ jobs:
acir-bench:
runs-on: ubuntu-20.04
needs: [build, configure]
# Note: not fully accurate, but to work with bench-summary needs to be the same as bench-e2e
if: needs.configure.outputs.non-barretenberg-cpp == 'true'
needs: [bench-test-gate, configure]
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
Expand Down Expand Up @@ -598,7 +622,7 @@ jobs:

yarn-project-formatting:
needs: [build, configure]
if: needs.configure.outputs.yarn-project == 'true' || github.ref_name == 'master'
if: needs.configure.outputs.yarn-project == 'true'
runs-on: ${{ needs.configure.outputs.username }}-x86
steps:
- uses: actions/checkout@v4
Expand All @@ -612,7 +636,6 @@ jobs:

yarn-project-test:
needs: [build, configure]
if: needs.configure.outputs.yarn-project == 'true' || github.ref_name == 'master'
runs-on: ${{ needs.configure.outputs.username }}-x86
steps:
- uses: actions/checkout@v4
Expand All @@ -627,7 +650,6 @@ jobs:
prover-client-test:
needs: [build, configure]
runs-on: ${{ needs.configure.outputs.username }}-x86
if: needs.configure.outputs.yarn-project == 'true' || github.ref_name == 'master'
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
Expand All @@ -638,16 +660,27 @@ jobs:
timeout-minutes: 40
run: earthly-ci --no-output ./yarn-project/+prover-client-test

# proving disabled
network-test:
needs: [build, configure]
if: needs.configure.outputs.yarn-project == 'true' || github.ref_name == 'master'
network-transfer-test:
needs: [network-test-gate, configure]
runs-on: ${{ needs.configure.outputs.username }}-x86
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- uses: ./.github/ci-setup-action
with:
concurrency_key: network-test-${{ matrix.test }}
- name: "Setup and Local Network Tests"
timeout-minutes: 60
run: sudo shutdown -P 60 ; earthly-ci --no-output ./yarn-project/+network-test --test=./test-transfer.sh

network-full-test:
needs: [network-test-gate, configure]
runs-on: ${{ needs.configure.outputs.username }}-x86
strategy:
max-parallel: 1
fail-fast: false
matrix:
test: [test-transfer.sh, test-4epochs.sh]
test: [test-4epochs.sh]
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
Expand All @@ -656,8 +689,6 @@ jobs:
concurrency_key: network-test-${{ matrix.test }}
- name: "Setup and Local Network Tests"
timeout-minutes: 60
# Only allow transfer test to run on every (non-network-all) PR
if: matrix.test == 'test-transfer.sh' || github.ref_name == 'master' || contains(github.event.pull_request.labels.*.name, 'network-all')
run: sudo shutdown -P 60 ; earthly-ci --no-output ./yarn-project/+network-test --test=./${{ matrix.test }}

kind-smoke-test:
Expand Down Expand Up @@ -690,8 +721,7 @@ jobs:
echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u aztecprotocolci --password-stdin
NAMESPACE=smoke FRESH_INSTALL=true VALUES_FILE=default.yaml ./scripts/network_test.sh ./src/spartan/smoke.test.ts
# note: proving disabled
kind-network-test:
kind-network-full-test:
needs: [build, configure]
if: contains(github.event.pull_request.labels.*.name, 'network-all') || (needs.configure.outputs.yarn-project == 'true' && github.ref_name == 'master')
runs-on: ${{ needs.configure.outputs.username }}-x86
Expand Down Expand Up @@ -838,23 +868,8 @@ jobs:
alert-comment-cc-users: "@ludamad @codygunton"
max-items-in-chart: 50

boxes:
needs: [build, configure]
runs-on: ${{ needs.configure.outputs.username }}-x86
if: github.ref_name == 'master' || contains(github.event.pull_request.labels.*.name, 'boxes') || contains(github.event.pull_request.labels.*.name, 'e2e-all')
steps:
- uses: actions/checkout@v4
with: { ref: "${{ github.event.pull_request.head.sha }}" }
- uses: ./.github/ci-setup-action
with:
concurrency_key: boxes
- name: Build
working-directory: ./boxes
timeout-minutes: 40
run: earthly-ci +export-boxes

boxes-test:
needs: [boxes, configure]
needs: [e2e-test-gate, configure]
runs-on: ${{ needs.configure.outputs.username }}-x86
strategy:
fail-fast: false
Expand All @@ -868,15 +883,18 @@ jobs:
with: { ref: "${{ github.event.pull_request.head.sha }}" }
- uses: ./.github/ci-setup-action
with:
# must be globally unique for build x runner
concurrency_key: boxes-${{ needs.configure.outputs.username }}-x86-${{ matrix.box }}-${{ matrix.browser }}
concurrency_key: boxes-${{ matrix.box }}-${{ matrix.browser }}
- name: Build
working-directory: ./boxes
timeout-minutes: 40
run: earthly-ci +export-boxes
- name: Box test
working-directory: ./boxes
timeout-minutes: 40
run: earthly-ci -P --no-output +test --box=${{ matrix.box }} --browser=${{ matrix.browser }} --mode=cache

rough-rhino-installer:
needs: [configure]
needs: [e2e-test-gate, configure]
runs-on: ${{ needs.configure.outputs.username }}-x86
steps:
- uses: actions/checkout@v4
Expand All @@ -890,7 +908,7 @@ jobs:

protocol-circuits-gates-report:
needs: [build, configure]
if: needs.configure.outputs.non-docs == 'true' && needs.configure.outputs.non-barretenberg-cpp == 'true'
if: needs.configure.outputs.non-docs == 'true' && needs.configure.outputs.non-misc-ci == 'true'
runs-on: ${{ needs.configure.outputs.username }}-x86
permissions:
pull-requests: write
Expand Down Expand Up @@ -995,14 +1013,14 @@ jobs:
- yarn-project-formatting
- yarn-project-test
- prover-client-test
- network-test
- network-transfer-test
- network-full-test # OK if skipped
- kind-smoke-test
- kind-network-test
- kind-network-full-test # OK if skipped
- l1-contracts-test
- docs-preview
# - bb-bench # non-blocking
- boxes
- boxes-test
- boxes-test # OK if skipped
# - protocol-circuits-gates-report # non-blocking
if: always()
outputs:
Expand Down Expand Up @@ -1044,7 +1062,7 @@ jobs:
actions: write
needs:
- merge-check
if: github.event.pull_request.draft == false && !cancelled()
if: github.event.pull_request.draft == false && !cancelled() && !true
steps:
- name: Check for Rerun
env:
Expand Down

0 comments on commit 835e6fd

Please sign in to comment.