-
Notifications
You must be signed in to change notification settings - Fork 236
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into zw/aux-challenges
- Loading branch information
Showing
4,901 changed files
with
145,285 additions
and
276,749 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
name: Earthly CI | ||
on: | ||
push: | ||
branches: [master] | ||
pull_request: {} | ||
workflow_dispatch: {} | ||
|
||
jobs: | ||
e2e: | ||
runs-on: ubuntu-latest | ||
env: | ||
EARTHLY_TOKEN: ${{ secrets.EARTHLY_TOKEN }} | ||
# TODO currently names are coupled to platform | ||
strategy: { matrix: { environment: [x86, arm], test: [e2e-escrow-contract, e2e-account-contracts] } } | ||
# cancel if reran on same PR if exists, otherwise if on same commit | ||
concurrency: | ||
group: ${{ matrix.test }}-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ matrix.environment }} | ||
cancel-in-progress: true | ||
steps: | ||
- uses: earthly/actions-setup@v1 | ||
with: | ||
version: v0.8.5 | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
submodules: recursive | ||
|
||
- name: Setup | ||
working-directory: ./scripts | ||
run: ./setup_env.sh ${{ matrix.environment }} ${{ secrets.DOCKERHUB_PASSWORD }} ${{ secrets.BUILD_INSTANCE_SSH_KEY }} | ||
|
||
- name: Test | ||
working-directory: ./yarn-project/end-to-end | ||
if: github.actor == 'ludamad' || github.actor == 'charlielye' || github.actor == 'sklppy88' || github.actor == 'alexghr' | ||
run: | | ||
# TODO put in script | ||
if [ "${{ matrix.environment }}" == "arm" ]; then | ||
PLATFORM=linux/arm64 | ||
elif [ "${{ matrix.environment }}" == "x86" ]; then | ||
PLATFORM=linux/amd64 | ||
fi | ||
earthly sat --org aztec launch --size 4xlarge --platform $PLATFORM build-${{github.actor}}-${{ matrix.environment }} || true | ||
if [ ${{ github.ref_name }} = master ] ; then | ||
# update the remote cache | ||
export EARTHLY_PUSH=true | ||
fi | ||
# TODO need to use more SAVE IMAGE --cache-hint and explicit BUILD statements for remote-cache to work well but then it should read artifacts from master done by all runners | ||
earthly -P --no-output --org aztec --remote-cache=aztecprotocol/cache:${{matrix.test}} --sat build-${{github.actor}}-${{ matrix.environment }} +${{ matrix.test }} | ||
bb-native-tests: | ||
runs-on: ubuntu-latest | ||
env: | ||
EARTHLY_TOKEN: ${{ secrets.EARTHLY_TOKEN }} | ||
# run for both x86_64 and arm64 | ||
# TODO currently names are coupled to platform | ||
strategy: { matrix: { environment: [x86, arm] } } | ||
# cancel if reran on same PR if exists, otherwise if on same commit | ||
concurrency: | ||
group: bb-native-tests-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ matrix.environment }} | ||
cancel-in-progress: true | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
submodules: recursive | ||
|
||
- name: Setup | ||
working-directory: ./scripts | ||
run: ./setup_env.sh ${{ matrix.environment }} ${{ secrets.DOCKERHUB_PASSWORD }} ${{ secrets.BUILD_INSTANCE_SSH_KEY }} | ||
|
||
- name: Build and test | ||
working-directory: ./barretenberg/cpp | ||
if: github.actor == 'ludamad' || github.actor == 'charlielye' || github.actor == 'sklppy88' || github.actor == 'alexghr' | ||
run: | | ||
# TODO put in script | ||
if [ "${{ matrix.environment }}" == "arm" ]; then | ||
PLATFORM=linux/arm64 | ||
elif [ "${{ matrix.environment }}" == "x86" ]; then | ||
PLATFORM=linux/amd64 | ||
fi | ||
earthly sat --org aztec launch --size 4xlarge --platform $PLATFORM build-${{github.actor}}-${{ matrix.environment }} || true | ||
if [ ${{ github.ref_name }} = master ] ; then | ||
# update the remote cache | ||
export EARTHLY_PUSH=true | ||
fi | ||
# TODO need to use more SAVE IMAGE --cache-hint and explicit BUILD statements for remote-cache to work well but then it should read artifacts from master done by all runners | ||
earthly -P --no-output --org aztec --remote-cache=aztecprotocol/cache:bb-native-tests --sat build-${{github.actor}}-${{ matrix.environment }} +test |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,22 +45,22 @@ jobs: | |
token: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }} | ||
- name: Push to aztec-nr repo | ||
run: | | ||
SUBREPO_PATH=aztec-nr | ||
SUBREPO_PATH=noir-projects/aztec-nr | ||
git config --global user.name AztecBot | ||
git config --global user.email [email protected] | ||
monorepo_url="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" | ||
# list all aztec-packages tags, take the "highest" version | ||
monorepo_tag="$(git tag --list aztec-packages-v* | sort --version-sort | tail -1)" | ||
monorepo_protocol_circuits_path="noir-packages/noir-protocol-circuits" | ||
monorepo_protocol_circuits_path="noir-projects/noir-protocol-circuits" | ||
# take all Nargo.toml files that reference noir-protocol-circuits | ||
nargo_files="$(find $SUBREPO_PATH -name 'Nargo.toml' | xargs grep --files-with-matches 'noir-protocol-circuits')" | ||
# match lines like this: | ||
# protocol_types = { path = "../../noir-protocol-circuits/src/crates/types" } | ||
# protocol_types = { path = "../../noir-protocol-circuits/crates/types" } | ||
# and replace with | ||
# protocol_types = { git="https://github.com/aztecprotocol/aztec-packages", tag="aztec-packages-v0.16.9", directory="noir-projects/noir-protocol-circuits/src/crates/types" } | ||
# protocol_types = { git="https://github.com/aztecprotocol/aztec-packages", tag="aztec-packages-v0.16.9", directory="noir-projects/noir-protocol-circuits/crates/types" } | ||
for nargo_file in $nargo_files; do | ||
sed --regexp-extended --in-place \ | ||
"s;path\s*=\s*\".*noir-protocol-circuits(.*)\";git=\"$monorepo_url\", tag=\"$monorepo_tag\", directory=\"$monorepo_protocol_circuits_path\1\";" \ | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
# Create a pull request from current Noir master. | ||
name: Pull from noir repo | ||
|
||
# Don't allow multiple of these running at once: | ||
concurrency: | ||
group: ${{ github.workflow }} | ||
cancel-in-progress: false | ||
on: | ||
# o | ||
workflow_dispatch: {} | ||
|
||
jobs: | ||
mirror_repo: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }} | ||
|
||
- name: Check for existing PR | ||
run: | | ||
set -xue # print commands | ||
# Enable gh executable. We spread out the API requests between the github actions bot token, and aztecbot | ||
export GH_TOKEN="${{ secrets.GITHUB_TOKEN }}" | ||
# Do we have a PR active? | ||
PR_URL=$(gh pr list --repo AztecProtocol/aztec-packages --head sync-noir --json url --jq ".[0].url") | ||
echo "PR_URL=$PR_URL" >> $GITHUB_ENV | ||
# What was our last merge on noir side? | ||
BASE_NOIR_COMMIT=`gh pr list --repo=noir-lang/noir --state merged --head aztec-packages --json mergeCommit --jq=.[0].mergeCommit.oid` | ||
echo "BASE_NOIR_COMMIT=$BASE_NOIR_COMMIT" >> $GITHUB_ENV | ||
# What was our last sync on aztec side? | ||
BASE_AZTEC_COMMIT=`curl https://raw.githubusercontent.com/noir-lang/noir/master/.aztec-sync-commit` | ||
echo "BASE_AZTEC_COMMIT=$BASE_AZTEC_COMMIT" >> $GITHUB_ENV | ||
- name: Generate PR body | ||
run: | | ||
# clone noir repo for manipulations, we use aztec bot token for writeability | ||
git clone https://x-access-token:${{ secrets.AZTEC_BOT_GITHUB_TOKEN }}@github.com/noir-lang/noir.git noir-repo | ||
set -xue # print commands | ||
# compute_commit_message: Create a filtered git log for release-please changelog / metadata | ||
function compute_commit_message() { | ||
cd noir-repo | ||
# Create a filtered git log for release-please changelog / metadata | ||
RAW_MESSAGE=$(git log --pretty=format:"%s" $BASE_NOIR_COMMIT..HEAD || true) | ||
# Fix Noir PR links and output message | ||
echo "$RAW_MESSAGE" | sed -E 's/\(#([0-9]+)\)/(https:\/\/github.com\/noir-lang\/noir\/pull\/\1)/g' | ||
cd .. | ||
} | ||
echo "$(compute_commit_message)" >> .PR_BODY_MESSAGE | ||
- name: Set git configure for commits | ||
run: | | ||
# identify ourselves, needed to commit | ||
git config --global user.name AztecBot | ||
git config --global user.email [email protected] | ||
# We push using git subrepo (https://github.com/ingydotnet/git-subrepo) | ||
# and push all Aztec commits as a single commit with metadata. | ||
- name: Push to branch | ||
run: | | ||
set -xue # print commands | ||
SUBREPO_PATH=noir/noir-repo | ||
BRANCH=sync-noir | ||
if [[ "$PR_URL" == "" ]]; then | ||
# if no staging branch, we can overwrite | ||
STAGING_BRANCH=$BRANCH | ||
else | ||
# otherwise we first reset our staging branch | ||
STAGING_BRANCH=$BRANCH-staging | ||
fi | ||
# Get the last sync PR's last commit state | ||
COMMIT_MESSAGE=$(cat .PR_BODY_MESSAGE) | ||
LINES=$(echo $COMMIT_MESSAGE | wc -l) | ||
function force_sync_staging() { | ||
# reset to last noir merge | ||
git checkout $STAGING_BRANCH || git checkout -b $STAGING_BRANCH | ||
git reset --hard "$BASE_AZTEC_COMMIT" | ||
# Reset our branch to our expected target | ||
git push origin $STAGING_BRANCH --force | ||
# force gitrepo to point to the right HEAD (we ignore .gitrepo contents otherwise) | ||
git config --file="$SUBREPO_PATH/.gitrepo" subrepo.commit "$BASE_NOIR_COMMIT" | ||
# we need to commit for git-subrepo | ||
git commit -am "[$LINES changes] $COMMIT_MESSAGE" | ||
if ./scripts/git-subrepo/lib/git-subrepo pull --force $SUBREPO_PATH --branch=master; then | ||
git reset --soft "$BASE_AZTEC_COMMIT" | ||
# We don't really need the sync commit on our side, and don't need .gitrepo at all except just in time for the command. | ||
git checkout origin/master -- noir/noir-repo/.aztec-sync-commit noir/noir-repo/.gitrepo | ||
git commit -am "[$LINES changes] $COMMIT_MESSAGE" | ||
git push origin $STAGING_BRANCH --force | ||
else | ||
echo "Problems syncing noir. Needs manual attention, might be a merge conflict." | ||
exit 1 | ||
fi | ||
} | ||
# merge_staging_branch: Merge our staging branch into aztec-packages. | ||
function merge_staging_branch() { | ||
# Fix PR branch | ||
git fetch # see recent change | ||
git checkout $BRANCH || git checkout -b $BRANCH | ||
git merge -Xtheirs origin/$STAGING_BRANCH -m "$COMMIT_MESSAGE" | ||
git push origin $BRANCH | ||
} | ||
force_sync_staging | ||
if [[ "$PR_URL" != "" ]]; then | ||
merge_staging_branch | ||
fi | ||
- name: Update PR | ||
run: | | ||
set -xue # print commands | ||
# Formatted for updating the PR, overrides for release-please commit message parsing | ||
PR_BODY=""" | ||
Automated pull of development from the [noir](https://github.com/noir-lang/noir) programming language, a dependency of Aztec. | ||
BEGIN_COMMIT_OVERRIDE | ||
$(cat .PR_BODY_MESSAGE) | ||
END_COMMIT_OVERRIDE""" | ||
# for cross-opening PR in noir repo, we use aztecbot's token | ||
export GH_TOKEN=${{ secrets.AZTEC_BOT_GITHUB_TOKEN }} | ||
if [[ "$PR_URL" == "" ]]; then | ||
gh pr create --repo AztecProtocol/aztec-packages --title "feat: Sync from noir" --body "$PR_BODY" --base master --head sync-noir | ||
else | ||
echo "Updating existing PR." | ||
gh pr edit "$PR_URL" --body "$PR_BODY" | ||
fi |
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
Oops, something went wrong.