chore(ci): towards ci3 #31370
Workflow file for this run
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
name: CI | |
on: | |
push: | |
branches: | |
- master | |
- provernet ./bootstrap.sh | |
- "*/ci-push*" | |
merge_group: | |
pull_request: | |
types: | |
- opened | |
- reopened | |
- synchronize | |
- ready_for_review | |
- labeled | |
branches-ignore: [devnet] | |
workflow_dispatch: | |
inputs: {} | |
concurrency: | |
# 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: | |
CI: 1 | |
DOCKERHUB_PASSWORD: "${{ secrets.DOCKERHUB_PASSWORD }}" | |
RUN_ID: ${{ github.run_id }} | |
RUN_ATTEMPT: ${{ github.run_attempt }} | |
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 }} | |
GITHUB_RUN_URL: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}" | |
GIT_COMMIT: ${{ github.event.pull_request.head.sha || github.sha }} | |
RUNNER_CONCURRENCY: 0 | |
jobs: | |
configure: | |
runs-on: ubuntu-latest | |
if: github.event.pull_request.draft == false | |
# Required permissions. | |
permissions: | |
pull-requests: read | |
# Set job outputs to values from filter step. | |
# Set username to a value derived from our github username. | |
outputs: | |
username: ${{ steps.compute_username.outputs.username }} | |
avm-transpiler: ${{ steps.filter.outputs.avm-transpiler }} | |
base-images: ${{ steps.filter.outputs.base-images }} | |
barretenberg: ${{ steps.filter.outputs.barretenberg }} | |
barretenberg-cpp: ${{ steps.filter.outputs.barretenberg-cpp }} | |
noir: ${{ steps.filter.outputs.noir }} | |
noir-projects: ${{ steps.filter.outputs.noir-projects }} | |
yarn-project: ${{ steps.filter.outputs.yarn-project }} | |
txe: ${{ steps.filter.outputs.txe }} | |
l1-contracts: ${{ steps.filter.outputs.l1-contracts }} | |
non-docs: ${{ steps.filter.outputs.non-docs }} | |
non-misc-ci: ${{ steps.filter.outputs.non-misc-ci }} | |
non-barretenberg-cpp: ${{ steps.filter.outputs.non-barretenberg-cpp }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: { ref: "${{ env.GIT_COMMIT }}" } | |
- name: Compute Username | |
id: compute_username | |
shell: bash | |
env: | |
REPO: "${{ github.repository }}" | |
BRANCH: ${{ github.event.pull_request.head.ref || github.ref_name }} | |
run: | | |
if [ "${{ github.event_name }}" == "pull_request" ]; then | |
instance_name="${BRANCH//\//_}" | |
echo "username=$instance_name" | |
echo "username=$instance_name" >> $GITHUB_OUTPUT | |
else | |
GIT_HASH="${{ github.sha }}" | |
GIT_HASH_LAST8=${GIT_HASH: -8} | |
GIT_HASH_LAST8_DEC=$(printf "%d" 0x$GIT_HASH_LAST8) | |
GIT_HASH_MODULO_8=$((GIT_HASH_LAST8_DEC % 8)) | |
echo "username=master-${GIT_HASH_MODULO_8}" | |
echo "username=master-${GIT_HASH_MODULO_8}" >> $GITHUB_OUTPUT | |
fi | |
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 | |
id: filter | |
with: | |
filters: | | |
barretenberg: | |
- 'barretenberg/**' | |
barretenberg-cpp: | |
- 'barretenberg/cpp/**' | |
noir: | |
- 'noir/**' | |
avm-transpiler: | |
- 'avm-transpiler/**' | |
l1-contracts: | |
- 'l1-contracts/**' | |
noir-projects: | |
- 'noir-projects/**' | |
yarn-project: | |
- 'yarn-project/**' | |
txe: | |
- 'yarn-project/txe/**' | |
non-barretenberg-cpp: | |
- '!(barretenberg/cpp/**)' | |
# don't consider AVM stuff 'core bb' | |
- barretenberg/cpp/pil/** | |
- barretenberg/cpp/src/barretenberg/vm/** | |
- barretenberg/cpp/src/barretenberg/**/generated/* | |
- barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.{hpp,cpp} | |
- barretenberg/cpp/src/barretenberg/bb/main.cpp | |
non-docs: | |
- '!(docs/**)' | |
non-misc-ci: | |
- '!(.github/**)' | |
# Always rebuild when this file changes | |
- .github/workflows/ci.yml | |
# Used by CI build as a base image. | |
base-images: | |
needs: [configure] | |
if: github.event.pull_request.draft == false | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: { ref: "${{ env.GIT_COMMIT }}" } | |
- name: "Build Images" | |
uses: ./.github/ensure-builder | |
timeout-minutes: 120 | |
with: | |
runner_type: builder-x86 | |
username: ${{ needs.configure.outputs.username }} | |
run: | | |
echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u aztecprotocolci --password-stdin | |
./build-images/bootstrap.sh ci | |
# CI for noir and bb. | |
ci-noir-bb: | |
needs: [base-images, configure] | |
runs-on: ubuntu-latest | |
if: needs.configure.outputs.barretenberg == 'true' || needs.configure.outputs.noir == 'true' || github.ref_name == 'master' | |
steps: | |
- uses: actions/checkout@v4 | |
with: { ref: "${{ env.GIT_COMMIT }}" } | |
- name: "CI (noir and bb)" | |
uses: ./.github/ensure-builder | |
timeout-minutes: 40 | |
with: | |
runner_type: builder-x86 | |
username: ${{ needs.configure.outputs.username }} | |
run: scripts/earthly-ci +ci-noir-bb | |
bootstrap: | |
needs: [ci-noir-bb, configure] | |
runs-on: ubuntu-latest | |
if: needs.configure.outputs.non-barretenberg-cpp == 'true' || github.ref_name == 'master' | |
steps: | |
- uses: actions/checkout@v4 | |
with: { ref: "${{ env.GIT_COMMIT }}" } | |
- name: "CI (l1-contracts, avm-transpiler, noir-projects, yarn-project)" | |
uses: ./.github/ensure-builder | |
timeout-minutes: 40 | |
with: | |
runner_type: builder-x86 | |
username: ${{ needs.configure.outputs.username }} | |
run: scripts/earthly-ci +bootstrap | |
ci-rest: | |
needs: [bootstrap, configure] | |
runs-on: ubuntu-latest | |
if: needs.configure.outputs.non-barretenberg-cpp == 'true' || github.ref_name == 'master' | |
steps: | |
- uses: actions/checkout@v4 | |
with: { ref: "${{ env.GIT_COMMIT }}" } | |
- name: "CI (l1-contracts, avm-transpiler, noir-projects, yarn-project)" | |
uses: ./.github/ensure-builder | |
timeout-minutes: 80 | |
with: | |
runner_type: builder-x86 | |
username: ${{ needs.configure.outputs.username }} | |
run: scripts/earthly-ci +ci-rest | |
images-e2e: | |
needs: [bootstrap, 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') | |
runs-on: ubuntu-latest | |
outputs: | |
e2e_list: ${{ steps.e2e_list.outputs.e2e_list }} | |
bench_list: ${{ steps.e2e_list.outputs.bench_list }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: { ref: "${{ env.GIT_COMMIT }}" } | |
- name: "E2E Images" | |
uses: ./.github/ensure-builder | |
timeout-minutes: 40 | |
with: | |
runner_type: builder-x86 | |
username: ${{ needs.configure.outputs.username }} | |
run: ./bootstrap.sh image-e2e | |
- name: Create Job Lists | |
id: e2e_list | |
env: | |
REF: contains(github.ref_name, 'gh-readonly-queue') && 'master' || github.ref_name | |
run: | | |
set -eu | |
LABELS="" | |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then | |
LABELS=$(jq -r '.pull_request.labels | map(.name) | join(",")' "${{ github.event_path }}") | |
fi | |
echo Labels: $LABELS | |
set -x | |
echo "e2e_list=$(./scripts/ci/get_e2e_jobs.sh ${{github.ref_name}} "$LABELS")" >> $GITHUB_OUTPUT | |
echo "bench_list=$(./scripts/ci/get_bench_jobs.sh ${{github.ref_name}} "$LABELS")" >> $GITHUB_OUTPUT | |
bench-test-gate: | |
needs: [images-e2e, 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: [images-e2e, 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: [ci-rest, 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." | |
docs: | |
needs: [ci-rest, configure] | |
runs-on: ubuntu-latest | |
if: needs.configure.outputs.non-barretenberg-cpp == 'true' || github.ref_name == 'master' | |
steps: | |
- uses: actions/checkout@v4 | |
with: { ref: "${{ env.GIT_COMMIT }}" } | |
- name: "Docs" | |
uses: ./.github/ensure-builder | |
timeout-minutes: 40 | |
with: | |
runner_type: builder-x86 | |
username: ${{ needs.configure.outputs.username }} | |
run: scripts/earthly-ci +docs-with-cache --ENV=staging --PR=${{ github.event.number }} \ | |
--AZTEC_BOT_COMMENTER_GITHUB_TOKEN=${{ secrets.AZTEC_BOT_GITHUB_TOKEN }} \ | |
--NETLIFY_AUTH_TOKEN=${{ secrets.NETLIFY_AUTH_TOKEN }} \ | |
--NETLIFY_SITE_ID=${{ secrets.NETLIFY_SITE_ID }} | |
e2e: | |
needs: [images-e2e, 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') | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
test: ${{ fromJson( needs.images-e2e.outputs.e2e_list )}} | |
steps: | |
- uses: actions/checkout@v4 | |
with: { ref: "${{ env.GIT_COMMIT }}" } | |
- uses: ./.github/ci-setup-action | |
- name: Determine runner type | |
id: runner_type | |
run: | | |
runner=$(./scripts/ci/select_runner.sh ${{ matrix.test }}) | |
echo "type=$runner" >> $GITHUB_OUTPUT | |
- name: Setup and Test | |
timeout-minutes: 40 | |
uses: ./.github/ensure-tester | |
with: | |
username: ${{ needs.configure.outputs.username }} | |
runner_type: ${{ steps.runner_type.outputs.type }} | |
run: | | |
docker pull aztecprotocol/aztec:${{ env.GIT_COMMIT }} | |
docker pull aztecprotocol/end-to-end:${{ env.GIT_COMMIT }} | |
FORCE_COLOR=1 ./yarn-project/end-to-end/scripts/e2e_test.sh ${{ matrix.test }} | |
# all the benchmarking end-to-end integration tests for aztec (not required to merge) | |
bench-e2e: | |
needs: [images-e2e, bench-test-gate, configure] | |
if: needs.images-e2e.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')) | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
test: ${{ fromJson( needs.images-e2e.outputs.bench_list )}} | |
steps: | |
- uses: actions/checkout@v4 | |
with: { ref: "${{ env.GIT_COMMIT }}" } | |
- uses: ./.github/ci-setup-action | |
- name: Determine runner type | |
id: runner_type | |
run: | | |
runner=$(./scripts/ci/select_runner.sh ${{ matrix.test }}) | |
echo "type=$runner" >> $GITHUB_OUTPUT | |
- name: Setup and Test | |
uses: ./.github/ensure-tester | |
timeout-minutes: 45 | |
with: | |
username: ${{ needs.configure.outputs.username }} | |
runner_type: ${{ steps.runner_type.outputs.type }} | |
ttl: 40 | |
run: | | |
docker pull aztecprotocol/aztec:${{ env.GIT_COMMIT }} | |
docker pull aztecprotocol/end-to-end:${{ env.GIT_COMMIT }} | |
export FORCE_COLOR=1 | |
export EARTHLY_BUILD_ARGS="${{ env.EARTHLY_BUILD_ARGS }}" | |
./yarn-project/end-to-end/scripts/e2e_test.sh ${{ matrix.test }} | |
# TODO(#9692): not working after e2e_test_config.yml refactoring | |
export COMMIT_HASH=${{ env.GIT_COMMIT }} | |
export PULL_REQUEST=${{ github.event.pull_request.number }} | |
export BRANCH=${{ github.ref_name }} | |
/usr/src/scripts/logs/upload_logs_to_s3.sh /usr/var/log | |
acir-bench: | |
runs-on: ubuntu-latest | |
needs: [bench-test-gate, ci-noir-bb, configure] | |
if: needs.configure.outputs.non-barretenberg-cpp == 'true' | |
steps: | |
- uses: actions/checkout@v4 | |
with: { ref: "${{ env.GIT_COMMIT }}" } | |
- uses: ./.github/ci-setup-action | |
- name: "Setup and Test" | |
uses: ./.github/ensure-tester | |
env: | |
USERNAME: ${{ needs.configure.outputs.username }} | |
timeout-minutes: 30 | |
with: | |
runner_type: 16core-tester-x86 | |
run: | | |
echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u aztecprotocolci --password-stdin | |
export CI=1 | |
export USE_CACHE=1 | |
if ci3/test_should_run acir-bench-$(./barretenberg/acir_tests/bootstrap.sh hash); then | |
scripts/earthly-ci ./barretenberg/acir_tests+bench-publish | |
ci3/cache_upload_flag acir-bench-$(./barretenberg/acir_tests/bootstrap.sh hash) | |
fi | |
bench-summary: | |
needs: | |
- acir-bench | |
- bench-e2e | |
- configure | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 100 # Downloading base benchmark from master requires access to history | |
ref: "${{ github.event.pull_request.head.sha }}" | |
- uses: ./.github/ci-setup-action | |
with: | |
concurrency_key: bench-summary-x86 | |
- name: "Build and upload bench aggregate file" | |
uses: ./.github/ensure-builder | |
with: | |
runner_type: builder-x86 | |
username: ${{ needs.configure.outputs.username }} | |
run: scripts/earthly-ci ./yarn-project/scripts/+bench-aggregate | |
- name: "Download base benchmark and package into earthly" | |
if: github.event_name == 'pull_request' | |
uses: ./.github/run-on-builder | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
BENCH_FOLDER: "./scripts/logs/tmp/bench" | |
PULL_REQUEST: "${{ github.event.pull_request.number }}" | |
with: | |
run: | | |
# Download the base benchmark locally (requires AWS creds and .git history) | |
mkdir -p $BENCH_FOLDER | |
./scripts/logs/download_base_benchmark_from_s3.sh | |
# Package it into an earthly artifact to read from bench-comment | |
scripts/earthly-ci ./scripts/logs+pack-base-benchmark | |
- name: "Generate summary comment if pull request" | |
if: github.event_name == 'pull_request' | |
uses: ./.github/run-on-builder | |
env: | |
AZTEC_BOT_GITHUB_TOKEN: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }} | |
with: | |
run: scripts/earthly-ci ./yarn-project/scripts/+bench-comment | |
# barretenberg (prover) native, AVM (public VM) and Merkle tree (world state) tests | |
# ran on own runner for resource reasons (memory x cpu intensive) | |
bb-native-tests: | |
runs-on: ubuntu-latest | |
needs: [base-images, configure] | |
steps: | |
- uses: actions/checkout@v4 | |
with: { ref: "${{ env.GIT_COMMIT }}" } | |
- name: "Setup" | |
run: | | |
# Ensure we can SSH into the spot instances we request | |
mkdir -p ~/.ssh | |
echo ${{ secrets.BUILD_INSTANCE_SSH_KEY }} | base64 --decode > ~/.ssh/build_instance_key | |
chmod 600 ~/.ssh/build_instance_key | |
echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u aztecprotocolci --password-stdin | |
- name: "Native Prover Tests" | |
env: | |
GITHUB_LOG: 1 | |
CI: 1 | |
USE_CACHE: 1 | |
run: | | |
export BRANCH=${{ needs.configure.outputs.username }}-bb-native-tests | |
if ci3/test_should_run barretenberg-test-$(./barretenberg/cpp/bootstrap.sh hash); then | |
ci3/bootstrap_ec2 "GITHUB_RUN_URL=$GITHUB_RUN_URL ./barretenberg/cpp/bootstrap.sh ci" | |
fi | |
network-4epochs-test: | |
needs: [images-e2e, ci-rest, configure] | |
if: needs.configure.outputs.yarn-project == 'true' && (github.ref_name == 'master' || contains(github.event.pull_request.labels.*.name, 'network-all')) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: { ref: "${{ env.GIT_COMMIT }}" } | |
- name: "Local Network Tests" | |
uses: ./.github/ensure-builder | |
timeout-minutes: 60 | |
with: | |
runner_type: builder-x86 | |
username: ${{ needs.configure.outputs.username }} | |
run: | | |
scripts/earthly-ci +network-test --test=./test-4epochs.sh | |
kind-smoke-test: | |
needs: [images-e2e, configure] | |
if: needs.configure.outputs.yarn-project == 'true' || github.ref_name == 'master' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: { ref: "${{ env.GIT_COMMIT }}" } | |
- name: Setup and KIND Network Test | |
timeout-minutes: 60 | |
uses: ./.github/ensure-tester | |
with: | |
username: ${{ needs.configure.outputs.username }} | |
runner_type: 8core-tester-x86 | |
ttl: 60 | |
run: | | |
docker pull aztecprotocol/aztec:${{ env.GIT_COMMIT }} | |
docker pull aztecprotocol/end-to-end:${{ env.GIT_COMMIT }} | |
echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u aztecprotocolci --password-stdin | |
cd yarn-project/end-to-end | |
NAMESPACE=smoke FRESH_INSTALL=true VALUES_FILE=default.yaml ./scripts/network_test.sh ./src/spartan/smoke.test.ts | |
kind-network-full-test: | |
needs: [images-e2e, network-test-gate, configure] | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- test: transfer.test.ts | |
values: 16-validators | |
runner_type: 16core-tester-x86 | |
timeout: 60 | |
- test: reorg.test.ts | |
values: 16-validators | |
runner_type: 16core-tester-x86-high-memory | |
timeout: 90 | |
- test: 4epochs.test.ts | |
values: 16-validators | |
runner_type: 16core-tester-x86 | |
timeout: 60 | |
# - test: gating-passive.test.ts | |
# values: 16-validators | |
# runner_type: 16core-tester-x86 | |
# timeout: 60 | |
steps: | |
- uses: actions/checkout@v4 | |
with: { ref: "${{ env.GIT_COMMIT }}" } | |
- name: Setup and KIND Network Test | |
timeout-minutes: ${{ matrix.config.timeout }} | |
uses: ./.github/ensure-tester | |
with: | |
username: ${{ needs.configure.outputs.username }} | |
runner_type: ${{ matrix.config.runner_type }} | |
spot_strategy: None # use on-demand machines | |
ttl: ${{ matrix.config.timeout }} | |
run: | | |
docker pull aztecprotocol/aztec:${{ env.GIT_COMMIT }} | |
docker pull aztecprotocol/end-to-end:${{ env.GIT_COMMIT }} | |
./ci.sh test-kind-network ${{ matrix.config.test }} ${{ matrix.config.values }} | |
- name: Copy Network Logs | |
if: always() | |
run: copy_from_tester yarn-project/end-to-end/scripts/network-test.log network-test.log || true | |
- name: Upload Network Logs | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: kind-network-test-${{ matrix.config.values }}-${{ matrix.config.test }}.log | |
path: network-test.log | |
bb-bench: | |
runs-on: ubuntu-latest | |
needs: [ci-noir-bb, configure] | |
if: needs.configure.outputs.barretenberg-cpp == 'true' | |
steps: | |
- uses: actions/checkout@v4 | |
with: { ref: "${{ env.GIT_COMMIT }}" } | |
- name: Build Bench Binaries | |
uses: ./.github/ensure-builder | |
with: | |
username: ${{ needs.configure.outputs.username }} | |
runner_type: builder-x86 | |
run: | | |
export CI=1 | |
export USE_CACHE=1 | |
# We gate the build with this | |
if ci3/test_should_run bb-bench-$(./barretenberg/cpp/bootstrap.sh hash); then | |
scripts/earthly-ci --push ./barretenberg/cpp/+bench-binaries | |
fi | |
- name: Run Bench | |
uses: ./.github/ensure-tester | |
env: | |
USERNAME: ${{ needs.configure.outputs.username }} | |
timeout-minutes: 40 | |
with: | |
runner_type: 16core-tester-x86 | |
run: | | |
HASH=$(ci3/cache_content_hash ./barretenberg/cpp/.rebuild_patterns)-${{ github.ref }} | |
export CI=1 | |
export USE_CACHE=1 | |
if ci3/test_should_run bb-bench-$HASH; then | |
scripts/earthly-ci --artifact ./barretenberg/cpp/+bench/bench.json --bench_mode=cache | |
ci3/cache_upload_flag bb-bench-$HASH | |
fi | |
- name: Copy Bench.json | |
run: copy_from_tester barretenberg/cpp/bench.json bench.json || true | |
- name: Store benchmark result | |
if: github.ref == 'refs/heads/master' | |
uses: benchmark-action/github-action-benchmark@4de1bed97a47495fc4c5404952da0499e31f5c29 | |
with: | |
name: C++ Benchmark | |
tool: "googlecpp" | |
output-file-path: bench.json | |
github-token: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }} | |
auto-push: true | |
alert-threshold: "105%" | |
comment-on-alert: true | |
fail-on-alert: false | |
alert-comment-cc-users: "@ludamad @codygunton" | |
max-items-in-chart: 50 | |
boxes-test: | |
needs: [ci-rest, e2e-test-gate, configure] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: { ref: "${{ github.event.pull_request.head.sha }}" } | |
- uses: ./.github/ci-setup-action | |
- name: Build Bench Binaries | |
uses: ./.github/ensure-builder | |
timeout-minutes: 40 | |
with: | |
username: ${{ needs.configure.outputs.username }} | |
runner_type: builder-x86 | |
run: | | |
export CI=1 | |
export USE_CACHE=1 | |
if ci3/test_should_run "boxes-test-$(./boxes/bootstrap.sh hash)"; then | |
./bootstrap.sh test-boxes | |
fi | |
rough-rhino-installer: | |
needs: [e2e-test-gate, configure] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: { ref: "${{ github.event.pull_request.head.sha }}" } | |
- uses: ./.github/ci-setup-action | |
- name: Rough Rhino Installer Helper Script | |
uses: ./.github/ensure-builder | |
timeout-minutes: 40 | |
with: | |
username: ${{ needs.configure.outputs.username }} | |
runner_type: builder-x86 | |
run: | | |
scripts/earthly-ci ./spartan/releases/rough-rhino/+test-all | |
protocol-circuits-gates-report: | |
needs: [ci-rest, configure] | |
if: needs.configure.outputs.non-docs == 'true' && needs.configure.outputs.non-barretenberg-cpp == 'true' | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: { ref: "${{ env.GIT_COMMIT }}" } | |
- name: "Noir Protocol Circuits Report" | |
uses: ./.github/ensure-builder | |
timeout-minutes: 40 | |
with: | |
username: ${{ needs.configure.outputs.username }} | |
runner_type: builder-x86 | |
run: | | |
scripts/earthly-ci --artifact ./noir-projects/+gates-report/gates_report.json | |
- name: Copy Report | |
run: | | |
copy_from_builder ./noir-projects/gates_report.json protocol_circuits_report.json | |
- name: Compare gates reports | |
id: gates_diff | |
uses: vezenovm/noir-gates-diff@510d7da8a7b027510ca0734761dfa9bcf3e8309d | |
continue-on-error: true | |
timeout-minutes: 1 | |
with: | |
report: protocol_circuits_report.json | |
summaryQuantile: 0 # Display any diff in gate count | |
- name: Add gates diff to sticky comment | |
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target' | |
uses: marocchino/sticky-pull-request-comment@v2 | |
continue-on-error: true | |
with: | |
# delete the comment in case changes no longer impact circuit sizes | |
delete: ${{ !steps.gates_diff.outputs.markdown }} | |
message: ${{ steps.gates_diff.outputs.markdown }} | |
public-functions-size-report: | |
needs: [ci-rest, configure] | |
if: needs.configure.outputs.non-docs == 'true' && needs.configure.outputs.non-misc-ci == 'true' | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: { ref: "${{ env.GIT_COMMIT }}" } | |
- name: "Aztec Public Functions Bytecode Size Report" | |
timeout-minutes: 40 | |
uses: ./.github/ensure-builder | |
with: | |
username: ${{ needs.configure.outputs.username }} | |
runner_type: builder-x86 | |
run: | | |
scripts/earthly-ci --artifact ./noir-projects/+public-functions-report/public_functions_report.json | |
- name: Copy Report | |
run: | | |
copy_from_builder noir-projects/public_functions_report.json public_functions_report.json | |
- name: Compare public functions bytecode size reports | |
id: public_functions_sizes_diff | |
uses: noir-lang/noir-gates-diff@d88f7523b013b9edd3f31c5cfddaef87a3fe1b48 | |
continue-on-error: true | |
timeout-minutes: 1 | |
with: | |
report: public_functions_report.json | |
header: | | |
# Changes to public function bytecode sizes | |
brillig_report: true | |
brillig_report_bytes: true | |
summaryQuantile: 0 # Display any diff in bytecode size count | |
- name: Add bytecode size diff to sticky comment | |
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target' | |
uses: marocchino/sticky-pull-request-comment@v2 | |
continue-on-error: true | |
timeout-minutes: 1 | |
with: | |
header: public_functions_size | |
delete: ${{ !steps.public_functions_sizes_diff.outputs.markdown }} | |
message: ${{ steps.public_functions_sizes_diff.outputs.markdown }} | |
merge-check: | |
runs-on: ubuntu-latest | |
needs: | |
- configure | |
- base-images | |
- ci-noir-bb | |
- ci-rest | |
- images-e2e | |
- docs | |
- e2e | |
- bb-native-tests | |
- network-4epochs-test | |
- kind-smoke-test | |
- kind-network-full-test | |
- boxes-test | |
if: always() | |
outputs: | |
failure: ${{ steps.set_failed_jobs.outputs.failure }} | |
failed_jobs: ${{ steps.set_failed_jobs.outputs.failed_jobs }} | |
steps: | |
- name: Check for Failures and Set Output | |
id: set_failed_jobs | |
env: | |
NEEDS_JOBS_JSON: ${{ toJson(needs) }} | |
run: | | |
echo "Processing failed jobs..." | |
failed_jobs=$(echo "$NEEDS_JOBS_JSON" | jq -r 'to_entries[] | select(.value.result == "failure") | .key' | paste -sd "," -) | |
echo "$failed_jobs" > .failed | |
echo "failure=${{contains(needs.*.result, 'failure')}}" >> $GITHUB_OUTPUT | |
echo "failed_jobs=$failed_jobs" >> $GITHUB_OUTPUT | |
- name: Report overall success (non-draft) | |
if: github.event.pull_request.draft == false | |
env: | |
# We treat any skipped or failing jobs as a failure for the workflow as a whole. | |
FAIL: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} | |
run: | | |
if [[ $FAIL == true ]]; then | |
echo "Jobs failed: $(cat .failed), merging not allowed." | |
exit 1 | |
else | |
echo "All jobs succeeded, merge allowed." | |
exit 0 | |
fi | |
- name: Block merge (draft) | |
if: github.event.pull_request.draft | |
run: echo "Can't merge drafts." && exit 1 | |
rerun-check: | |
runs-on: ubuntu-latest | |
permissions: | |
actions: write | |
needs: | |
- merge-check | |
if: github.event.pull_request.draft == false && !cancelled() | |
steps: | |
- name: Check for Rerun | |
env: | |
GH_REPO: ${{ github.repository }} | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
if [[ ${{ needs.merge-check.outputs.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 | |
notify: | |
runs-on: ubuntu-latest | |
needs: | |
- merge-check | |
if: github.event.pull_request.draft == false && github.ref == 'refs/heads/master' && failure() && github.run_attempt >= 2 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Get Authors of Recent Commit | |
id: get_authors | |
run: | | |
git fetch --depth=1 origin ${{ github.sha }} | |
authors=$(git log -1 --pretty=format:'%an <%ae>' ${{ github.sha }}) | |
echo "authors=${authors}" >> $GITHUB_OUTPUT | |
- name: Send notification to aztec3-ci channel if workflow failed on master | |
uses: slackapi/[email protected] | |
with: | |
payload: | | |
{ | |
"text": "Master Github Actions failure", | |
"url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}", | |
"authors": "${{ steps.get_authors.outputs.authors }}", | |
"failed_jobs": "${{ needs.merge-check.outputs.failed_jobs }}" | |
} | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_NOTIFY_WORKFLOW_TRIGGER_URL2 }} |