Skip to content

chore(ci)!: Add Brillig loop bytecode size regression and update noir-gates-diff report #4

chore(ci)!: Add Brillig loop bytecode size regression and update noir-gates-diff report

chore(ci)!: Add Brillig loop bytecode size regression and update noir-gates-diff report #4

name: Report Brillig opcodes diff
on:
push:
branches:
- master
pull_request:
jobs:
build-nargo:
runs-on: ubuntu-latest
strategy:
matrix:
target: [x86_64-unknown-linux-gnu]
steps:
- name: Checkout Noir repo
uses: actions/checkout@v4
- name: Setup toolchain
uses: dtolnay/[email protected]
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.target }}
cache-on-failure: true
save-if: ${{ github.event_name != 'merge_group' }}
- name: Build Nargo
run: cargo build --package nargo_cli --release
- name: Package artifacts
run: |
mkdir dist
cp ./target/release/nargo ./dist/nargo
7z a -ttar -so -an ./dist/* | 7z a -si ./nargo-x86_64-unknown-linux-gnu.tar.gz
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: nargo
path: ./dist/*
retention-days: 3
compare_brillig_opcode_reports:
needs: [build-nargo]
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Download nargo binary
uses: actions/download-artifact@v4
with:
name: nargo
path: ./nargo
- name: Set nargo on PATH
run: |
nargo_binary="${{ github.workspace }}/nargo/nargo"
chmod +x $nargo_binary
echo "$(dirname $nargo_binary)" >> $GITHUB_PATH
export PATH="$PATH:$(dirname $nargo_binary)"
nargo -V
- name: Generate Brillig opcodes report
working-directory: ./test_programs
run: |
chmod +x gates_report_brillig.sh
./gates_report_brillig.sh
mv gates_report_brillig.json ../gates_report_brillig.json
- name: Compare Brillig opcode reports
id: gates_diff
uses: noir-lang/noir-gates-diff@93e4cae1229d669de61f0ac76d32e47cefe4adcc
with:
report: gates_report_brillig.json
summaryQuantile: 0.9 # only display the 10% most significant circuit size diffs in the summary (defaults to 20%)
- 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
with:
# delete the comment in case changes no longer impact circuit sizes
delete: ${{ !steps.gates_diff.outputs.markdown }}
message: ${{ steps.gates_diff.outputs.markdown }}