Skip to content

Commit 29c1da0

Browse files
committed
Merge remote-tracking branch 'origin/next' into lw/checkpoint_circuit
2 parents 2c6001d + a265415 commit 29c1da0

1,634 files changed

Lines changed: 43680 additions & 92125 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci3-external.yml

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ jobs:
3131
with:
3232
# The commit to checkout. We want our actual commit, and not the result of merging the PR to the target.
3333
ref: ${{ github.event.pull_request.head.sha || github.sha }}
34+
persist-credentials: false
3435

3536
# NOTE: in ci3.yml we just rely on draft mode not being mergable.
3637
# Here we are a little more careful than just skipping the worklfow, in case of an edge case allowing merge.
@@ -43,7 +44,7 @@ jobs:
4344
run: |
4445
set -o pipefail
4546
git fetch origin ${{ github.event.pull_request.base.ref }} --depth=1 &>/dev/null
46-
forbidden_changes=$(git diff --name-only origin/${{ github.event.pull_request.base.ref }} HEAD -- ci3 .github ci.sh)
47+
forbidden_changes=$(git diff --name-only origin/${{ github.event.pull_request.base.ref }} HEAD -- ci3 .github ci.sh scripts)
4748
if echo "$forbidden_changes" | grep -q .; then
4849
echo "Error: External PRs can't contain CI changes (forbidden files: $forbidden_changes)."
4950
exit 1
@@ -63,6 +64,10 @@ jobs:
6364
# Remove any ci-external-once labels.
6465
GITHUB_TOKEN=${{ secrets.AZTEC_BOT_GITHUB_TOKEN }} gh pr edit ${{ github.event.pull_request.number }} --remove-label "ci-external-once"
6566
67+
- name: CI Merge Queue Override (grind on PR)
68+
if: contains(github.event.pull_request.labels.*.name, 'ci-merge-queue')
69+
run: echo "CI_MERGE_QUEUE=1" >> $GITHUB_ENV
70+
6671
- name: CI Full Override
6772
if: contains(github.event.pull_request.labels.*.name, 'ci-full')
6873
run: echo "CI_FULL=1" >> $GITHUB_ENV
@@ -82,10 +87,21 @@ jobs:
8287
echo ${{ secrets.BUILD_INSTANCE_SSH_KEY }} | base64 --decode > ~/.ssh/build_instance_key
8388
chmod 600 ~/.ssh/build_instance_key
8489
90+
- name: Get Tree Hash
91+
run: echo "TREE_HASH=$(git rev-parse HEAD^{tree})" >> $GITHUB_ENV
92+
93+
- name: Check CI Cache
94+
id: ci_cache
95+
uses: actions/cache@v3
96+
with:
97+
path: ci-success.txt
98+
key: ci-external-${{ env.TREE_HASH }}
99+
85100
#############
86101
# Run
87102
#############
88103
- name: Run
104+
if: steps.ci_cache.outputs.cache-hit != 'true'
89105
env:
90106
# We need to pass these creds to start the AWS ec2 instance.
91107
# They are not injected into that instance. Instead, it has minimal
@@ -97,8 +113,32 @@ jobs:
97113
ARCH: amd64
98114
RUN_ID: ${{ github.run_id }}
99115
run: |
100-
if [ "${CI_FULL:-0}" -eq 1 ]; then
116+
if [ "${CI_MERGE_QUEUE:-0}" -eq 1 ]; then
101117
exec ./ci.sh merge-queue
118+
elif [ "${CI_FULL:-0}" -eq 1 ]; then
119+
exec ./ci.sh full
102120
else
103121
exec ./ci.sh fast
104122
fi
123+
124+
- name: Save CI Success
125+
if: steps.ci_cache.outputs.cache-hit != 'true'
126+
run: echo "success" > ci-success.txt
127+
128+
# If we have passed CI and labelled with ci-squash-and-merge, squash the PR.
129+
# This will rerun CI on the squash commit - but is intended to be a no-op due to caching.
130+
- name: CI Squash and Merge
131+
if: contains(github.event.pull_request.labels.*.name, 'ci-squash-and-merge')
132+
env:
133+
GITHUB_TOKEN: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }}
134+
run: |
135+
# Reauth the git repo with our GITHUB_TOKEN
136+
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}
137+
# Get the base commit (merge-base) for the PR
138+
./scripts/merge-train/squash-pr.sh \
139+
"${{ github.event.pull_request.number }}" \
140+
"${{ github.event.pull_request.head.ref }}" \
141+
"${{ github.event.pull_request.base.ref }}" \
142+
"${{ github.event.pull_request.base.sha }}"
143+
gh pr edit "${{ github.event.pull_request.number }}" --remove-label "ci-squash-and-merge"
144+
gh pr merge "${{ github.event.pull_request.number }}" --auto -m || true

.github/workflows/ci3.yml

Lines changed: 39 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ jobs:
3434
with:
3535
# The commit to checkout. We want our actual commit, and not the result of merging the PR to the target.
3636
ref: ${{ github.event.pull_request.head.sha || github.sha }}
37+
# Fetch PR commits depth (we'll deepen by 1 in squash script if needed)
38+
fetch-depth: ${{ github.event.pull_request.commits || 0 }}
39+
persist-credentials: false
3740

3841
- name: CI Merge Queue Override (grind on PR)
3942
if: contains(github.event.pull_request.labels.*.name, 'ci-merge-queue')
@@ -51,10 +54,6 @@ jobs:
5154
if: contains(github.event.pull_request.labels.*.name, 'ci-no-fail-fast')
5255
run: echo "NO_FAIL_FAST=1" >> $GITHUB_ENV
5356

54-
- name: Barretenberg CI Override
55-
if: contains(github.event.pull_request.labels.*.name, 'ci-barretenberg')
56-
run: echo "BARRETENBERG_CI=1" >> $GITHUB_ENV
57-
5857
- name: Compute Target Branch
5958
id: target_branch
6059
run: |
@@ -88,8 +87,7 @@ jobs:
8887
mkdir -p ~/.ssh
8988
echo ${{ secrets.BUILD_INSTANCE_SSH_KEY }} | base64 --decode > ~/.ssh/build_instance_key
9089
chmod 600 ~/.ssh/build_instance_key
91-
# Install required packages.
92-
sudo apt update && sudo apt install -y redis-tools parallel
90+
sudo apt install -y --no-install-recommends redis-tools parallel
9391
9492
- name: Prepare GCP key
9593
env:
@@ -98,10 +96,21 @@ jobs:
9896
echo "$GCP_SA_KEY" | base64 -w 0 > gcp_sa_key.b64
9997
echo "GCP_SA_KEY_B64=$(cat gcp_sa_key.b64)" >> $GITHUB_ENV
10098
99+
- name: Get Tree Hash
100+
run: echo "TREE_HASH=$(git rev-parse HEAD^{tree})" >> $GITHUB_ENV
101+
102+
- name: Check CI Cache
103+
id: ci_cache
104+
uses: actions/cache@v3
105+
with:
106+
path: ci-success.txt
107+
key: ci-${{ github.event_name == 'merge_group' && 'merge-queue' || env.CI_FULL == '1' && 'full' || env.CI_DOCS == '1' && 'docs' || env.CI_BARRETENBERG == '1' && 'barretenberg' || 'fast' }}-${{ env.TREE_HASH }}
108+
101109
#############
102110
# Run
103111
#############
104112
- name: Run
113+
if: steps.ci_cache.outputs.cache-hit != 'true'
105114
env:
106115
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
107116
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
@@ -136,12 +145,34 @@ jobs:
136145
exec ./ci.sh fast
137146
fi
138147
148+
- name: Save CI Success
149+
if: steps.ci_cache.outputs.cache-hit != 'true'
150+
run: echo "success" > ci-success.txt
151+
152+
# If we have passed CI and labelled with ci-squash-and-merge, squash the PR.
153+
# This will rerun CI on the squash commit - but is intended to be a no-op due to caching.
154+
- name: CI Squash and Merge
155+
if: contains(github.event.pull_request.labels.*.name, 'ci-squash-and-merge')
156+
env:
157+
GITHUB_TOKEN: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }}
158+
run: |
159+
# Reauth the git repo with our GITHUB_TOKEN
160+
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}
161+
# Get the base commit (merge-base) for the PR
162+
./scripts/merge-train/squash-pr.sh \
163+
"${{ github.event.pull_request.number }}" \
164+
"${{ github.event.pull_request.head.ref }}" \
165+
"${{ github.event.pull_request.base.ref }}" \
166+
"${{ github.event.pull_request.base.sha }}"
167+
gh pr edit "${{ github.event.pull_request.number }}" --remove-label "ci-squash-and-merge"
168+
gh pr merge "${{ github.event.pull_request.number }}" --auto -m || true
169+
139170
- name: Download benchmarks
140-
if: github.event_name == 'merge_group'
171+
if: github.event_name == 'merge_group' || env.CI_FULL == '1'
141172
run: ./ci.sh gh-bench
142173

143174
- name: Upload benchmarks
144-
if: github.event_name == 'merge_group'
175+
if: github.event_name == 'merge_group' || env.CI_FULL == '1'
145176
uses: benchmark-action/github-action-benchmark@4de1bed97a47495fc4c5404952da0499e31f5c29
146177
with:
147178
name: Aztec Benchmarks
@@ -155,39 +186,3 @@ jobs:
155186
comment-on-alert: false
156187
fail-on-alert: false
157188
max-items-in-chart: 100
158-
159-
notify:
160-
runs-on: ubuntu-latest
161-
if: github.event_name == 'push' && failure()
162-
needs:
163-
- ci
164-
steps:
165-
- name: Checkout Code
166-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
167-
168-
- name: Get Context
169-
id: get_context
170-
run: |
171-
authors=$(git log -1 --pretty=format:'%an <%ae>')
172-
echo "authors=${authors}" >> $GITHUB_OUTPUT
173-
# Note, we have to make sure double quotes don't break our JSON.
174-
title=$(git log -1 --pretty=format:'%s' | sed s/\"/\'/g)
175-
echo "commit_title=${title}" >> $GITHUB_OUTPUT
176-
failed_jobs=""
177-
[ "${{ needs.ci-grind.result }}" = "failure" ] && failed_jobs+="ci-grind"
178-
[ "${{ needs.ci.result }}" = "failure" ] && failed_jobs+="ci"
179-
echo "failed_jobs=${failed_jobs}" >> $GITHUB_OUTPUT
180-
cat $GITHUB_OUTPUT
181-
182-
- name: Send Notification
183-
uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001
184-
with:
185-
payload: |
186-
{
187-
"text": "Failure on ${{ github.ref_name }}\nCommit: ${{ steps.get_context.outputs.commit_title }}",
188-
"url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
189-
"authors": "${{ steps.get_context.outputs.authors }}",
190-
"failed_jobs": "${{ steps.get_context.outputs.failed_jobs }}"
191-
}
192-
env:
193-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_NOTIFY_WORKFLOW_TRIGGER_URL2 }}

.github/workflows/docs-preview.yml

Lines changed: 0 additions & 152 deletions
This file was deleted.

0 commit comments

Comments
 (0)