Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .coderabbit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,6 @@ reviews:
biome:
# Enable Biome tool
enabled: true
# Hadolint tool configuration
hadolint:
# Enable Hadolint tool for Dockerfile linting
enabled: true
# SwiftLint tool configuration
swiftlint:
# Enable SwiftLint tool
Expand Down
92 changes: 92 additions & 0 deletions .github/actions/benchmark/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: 'Run Benchmarks'
description: 'Run Aztec benchmarks, generate diff report, and upload results'

inputs:
pr-number:
description: 'Pull request number'
required: true
base-ref:
description: 'Base branch ref for comparison'
required: true
head-ref:
description: 'Head branch ref (source branch of PR)'
required: true
bench-dir:
description: 'Directory for benchmark files'
required: false
default: './benchmarks'

runs:
using: 'composite'
steps:
- name: Encode base branch name
id: encode-base
shell: bash
run: |
# Replace slashes with hyphens for artifact naming
# GitHub artifact names don't support slashes
encoded=$(echo "${{ inputs.base-ref }}" | sed 's/\//-/g')
echo "base-ref-encoded=${encoded}" >> $GITHUB_OUTPUT

# Determine which workflow created the baseline
# dev/main baselines are from update-baseline.yml, others from pr-checks.yml
if [[ "${{ inputs.base-ref }}" == "dev" || "${{ inputs.base-ref }}" == "main" ]]; then
echo "workflow=update-baseline.yml" >> $GITHUB_OUTPUT
else
echo "workflow=pr-checks.yml" >> $GITHUB_OUTPUT
fi

- name: Download baseline artifact
id: download-baseline
continue-on-error: true
uses: dawidd6/action-download-artifact@0bd50d53a6d7fb5cb921e607957e9cc12b4ce392 # v12
with:
workflow: ${{ steps.encode-base.outputs.workflow }}
branch: ${{ inputs.base-ref }}
name: benchmark-baseline-${{ steps.encode-base.outputs.base-ref-encoded }}
path: ${{ inputs.bench-dir }}
if_no_artifact_found: warn

- name: Generate Markdown diff
uses: defi-wonderland/aztec-benchmark/action@chore/v4
with:
base_suffix: '_latest'
current_suffix: '_new'

- name: Comment diff on PR
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ inputs.pr-number }}
body-path: benchmark-comparison.md

- name: Prepare benchmark files for upload
shell: bash
run: |
# Remove old _latest files (from base branch fetch) before renaming
rm -f ${{ inputs.bench-dir }}/*_latest.benchmark.json

# Rename _new files to _latest (the canonical stored format)
for file in ${{ inputs.bench-dir }}/*_new.benchmark.json; do
if [ -f "$file" ]; then
new_name="${file/_new.benchmark.json/_latest.benchmark.json}"
echo "Renaming $file -> $new_name"
mv "$file" "$new_name"
fi
done

- name: Encode head branch name
id: encode-head
shell: bash
run: |
# Replace slashes with hyphens for artifact naming
# GitHub artifact names don't support slashes
encoded=$(echo "${{ inputs.head-ref }}" | sed 's/\//-/g')
echo "head-ref-encoded=${encoded}" >> $GITHUB_OUTPUT

- name: Upload branch baseline
uses: actions/upload-artifact@v4
with:
name: benchmark-baseline-${{ steps.encode-head.outputs.head-ref-encoded }}
path: ${{ inputs.bench-dir }}/*_latest.benchmark.json
retention-days: 90
if-no-files-found: error
10 changes: 10 additions & 0 deletions .github/actions/js-tests/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: 'Run JS Tests'
description: 'Run JavaScript integration tests'

runs:
using: 'composite'
steps:
- name: Run JS tests
shell: bash
run: |
script -e -c "BASE_PXE_URL=http://localhost NODE_NO_WARNINGS=1 yarn test:js"
16 changes: 16 additions & 0 deletions .github/actions/noir-tests/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: 'Run Noir Tests'
description: 'Run Noir contract tests'

inputs:
threads:
description: 'Number of test threads'
required: false
default: '12'

runs:
using: 'composite'
steps:
- name: Run Noir tests
shell: bash
run: |
script -e -c "aztec test --test-threads ${{ inputs.threads }}"
81 changes: 81 additions & 0 deletions .github/actions/setup-aztec/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: 'Setup Aztec Environment'
description: 'Common setup for Aztec development: Node, Foundry, Aztec CLI, dependencies, and local network'

inputs:
start-pxe:
description: 'Whether to start PXE node'
required: false
default: 'false'
run-codegen:
description: 'Whether to run aztec codegen'
required: false
default: 'false'

outputs:
aztec-version:
description: 'The detected Aztec version'
value: ${{ steps.aztec-version.outputs.version }}

runs:
using: 'composite'
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22.17.0'

- name: Update PATH for Aztec
shell: bash
run: |
echo "$HOME/.aztec/current/bin" >> $GITHUB_PATH
echo "$HOME/.aztec/current/node_modules/.bin" >> $GITHUB_PATH
echo "$HOME/.aztec/bin" >> $GITHUB_PATH

- name: Detect Aztec version
id: aztec-version
shell: bash
run: |
VER=$(node -p "require('./package.json').config.aztecVersion")
echo "version=$VER" >> "$GITHUB_OUTPUT"
echo "Aztec version: $VER"

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Install Aztec CLI
shell: bash
run: |
INSTALL_URL="https://install.aztec.network/${{ steps.aztec-version.outputs.version }}/"
echo "Installing from: $INSTALL_URL"
curl -sL $INSTALL_URL > tmp.sh
VERSION=${{ steps.aztec-version.outputs.version }} bash tmp.sh <<< yes "yes"

- name: Switch CLI to target version
shell: bash
run: aztec-up install ${{ steps.aztec-version.outputs.version }}

- name: Start local network
if: inputs.start-pxe == 'true'
shell: bash
run: aztec start --local-network &

- name: Install dependencies
shell: bash
run: yarn --frozen-lockfile

- name: Compile contracts
shell: bash
run: aztec compile

- name: Codegen wrappers
if: inputs.run-codegen == 'true'
shell: bash
run: aztec codegen target --outdir src/artifacts -f

- name: Start PXE node
if: inputs.start-pxe == 'true'
shell: bash
run: |
VERSION=${{ steps.aztec-version.outputs.version }} aztec \
start --port 8081 --pxe --pxe.nodeUrl=http://localhost:8080/ \
--pxe.proverEnabled false &
60 changes: 18 additions & 42 deletions .github/workflows/canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,60 +2,35 @@ name: Canary Release

on: workflow_dispatch

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
# ══════════════════════════════════════════════════════════════════════════════
# CANARY RELEASE JOB
# ══════════════════════════════════════════════════════════════════════════════
export:
name: Generate Canary Release
environment: Development
runs-on: ubuntu-latest
runs-on: ubuntu-latest-m
timeout-minutes: 60

env:
PROJECT_NAME: '@defi-wonderland/aztec-standards'

steps:
- name: Checkout Repo
- name: Checkout
uses: actions/checkout@v4

- name: Install Node
uses: actions/setup-node@v4
with:
node-version: "22.17.0"
registry-url: "https://registry.npmjs.org"
cache: "yarn"

- name: Set up Docker
uses: docker/setup-buildx-action@v2

- name: Detect Aztec version
id: aztec-version
run: |
AZTEC_VERSION=$(node -p "require('./package.json').config.aztecVersion")
echo "version=$AZTEC_VERSION" >> "$GITHUB_OUTPUT"
echo "Aztec version is $AZTEC_VERSION"

- name: Install Aztec CLI
run: |
curl -s https://install.aztec.network > tmp.sh
VERSION=${{ steps.aztec-version.outputs.version }} bash tmp.sh <<< yes "yes"
- name: Update path
run: echo "/home/runner/.aztec/bin" >> $GITHUB_PATH
fetch-depth: 0

- name: Set Aztec version
run: |
VERSION=${{ steps.aztec-version.outputs.version }} aztec-up

# This is a temporary hack to fix a problem with v3 releases.
- name: Manually tag the aztec version as `latest`
run: |
docker tag aztecprotocol/aztec:${{ steps.aztec-version.outputs.version }} aztecprotocol/aztec:latest

- name: Install dependencies
run: yarn --frozen-lockfile

- name: Compile
run: yarn compile

- name: Codegen
run: aztec codegen target --outdir artifacts
- name: Setup Aztec environment
id: setup-aztec
uses: ./.github/actions/setup-aztec
with:
start-pxe: 'false'
run-codegen: 'true'

- name: Compile artifacts to JS
run: |
Expand Down Expand Up @@ -100,6 +75,7 @@ jobs:
cp LICENSE export/${{ env.PROJECT_NAME }}/

cat package.json | jq 'del(.scripts, .jest, ."lint-staged", .packageManager, .devDependencies, .dependencies, .engines, .resolutions)' > export/${{ env.PROJECT_NAME }}/package.json

- name: Publish to NPM
run: cd export/${{ env.PROJECT_NAME }} && npm publish --access public --tag canary
env:
Expand Down
Loading