|
1 | | -# name: Report gates diff |
2 | | - |
3 | | -# on: |
4 | | -# push: |
5 | | -# branches: |
6 | | -# - master |
7 | | -# pull_request: |
8 | | - |
9 | | -# jobs: |
10 | | -# build-nargo: |
11 | | -# runs-on: ubuntu-latest |
12 | | -# strategy: |
13 | | -# matrix: |
14 | | -# target: [x86_64-unknown-linux-gnu] |
15 | | - |
16 | | -# steps: |
17 | | -# - name: Checkout Noir repo |
18 | | -# uses: actions/checkout@v4 |
19 | | - |
20 | | -# - name: Setup toolchain |
21 | | - |
22 | | - |
23 | | -# - uses: Swatinem/rust-cache@v2 |
24 | | -# with: |
25 | | -# key: ${{ matrix.target }} |
26 | | -# cache-on-failure: true |
27 | | -# save-if: ${{ github.event_name != 'merge_group' }} |
28 | | - |
29 | | -# - name: Build Nargo |
30 | | -# run: cargo build --package nargo_cli --release |
31 | | - |
32 | | -# - name: Package artifacts |
33 | | -# run: | |
34 | | -# mkdir dist |
35 | | -# cp ./target/release/nargo ./dist/nargo |
36 | | -# 7z a -ttar -so -an ./dist/* | 7z a -si ./nargo-x86_64-unknown-linux-gnu.tar.gz |
37 | | - |
38 | | -# - name: Upload artifact |
39 | | -# uses: actions/upload-artifact@v4 |
40 | | -# with: |
41 | | -# name: nargo |
42 | | -# path: ./dist/* |
43 | | -# retention-days: 3 |
44 | | - |
45 | | - |
46 | | -# compare_gas_reports: |
47 | | -# needs: [build-nargo] |
48 | | -# runs-on: ubuntu-latest |
49 | | -# permissions: |
50 | | -# pull-requests: write |
51 | | - |
52 | | -# steps: |
53 | | -# - uses: actions/checkout@v4 |
54 | | - |
55 | | -# - name: Download nargo binary |
56 | | -# uses: actions/download-artifact@v4 |
57 | | -# with: |
58 | | -# name: nargo |
59 | | -# path: ./nargo |
60 | | - |
61 | | -# - name: Set nargo on PATH |
62 | | -# run: | |
63 | | -# nargo_binary="${{ github.workspace }}/nargo/nargo" |
64 | | -# chmod +x $nargo_binary |
65 | | -# echo "$(dirname $nargo_binary)" >> $GITHUB_PATH |
66 | | -# export PATH="$PATH:$(dirname $nargo_binary)" |
67 | | -# nargo -V |
68 | | - |
69 | | -# - name: Generate gates report |
70 | | -# working-directory: ./test_programs |
71 | | -# run: | |
72 | | -# ./gates_report.sh |
73 | | -# mv gates_report.json ../gates_report.json |
| 1 | +name: Report gates diff |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + pull_request: |
| 8 | + |
| 9 | +jobs: |
| 10 | + build-nargo: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + strategy: |
| 13 | + matrix: |
| 14 | + target: [x86_64-unknown-linux-gnu] |
| 15 | + |
| 16 | + steps: |
| 17 | + - name: Checkout Noir repo |
| 18 | + uses: actions/checkout@v4 |
| 19 | + |
| 20 | + - name: Setup toolchain |
| 21 | + |
| 22 | + |
| 23 | + - uses: Swatinem/rust-cache@v2 |
| 24 | + with: |
| 25 | + key: ${{ matrix.target }} |
| 26 | + cache-on-failure: true |
| 27 | + save-if: ${{ github.event_name != 'merge_group' }} |
| 28 | + |
| 29 | + - name: Build Nargo |
| 30 | + run: cargo build --package nargo_cli --release |
| 31 | + |
| 32 | + - name: Package artifacts |
| 33 | + run: | |
| 34 | + mkdir dist |
| 35 | + cp ./target/release/nargo ./dist/nargo |
| 36 | + 7z a -ttar -so -an ./dist/* | 7z a -si ./nargo-x86_64-unknown-linux-gnu.tar.gz |
| 37 | +
|
| 38 | + - name: Upload artifact |
| 39 | + uses: actions/upload-artifact@v4 |
| 40 | + with: |
| 41 | + name: nargo |
| 42 | + path: ./dist/* |
| 43 | + retention-days: 3 |
| 44 | + |
| 45 | + |
| 46 | + compare_gates_reports: |
| 47 | + needs: [build-nargo] |
| 48 | + runs-on: ubuntu-latest |
| 49 | + permissions: |
| 50 | + pull-requests: write |
| 51 | + |
| 52 | + steps: |
| 53 | + - uses: actions/checkout@v4 |
| 54 | + |
| 55 | + - name: Install `bb` |
| 56 | + run: | |
| 57 | + ./scripts/install_bb.sh |
| 58 | + echo "$HOME/.bb/" >> $GITHUB_PATH |
| 59 | +
|
| 60 | + - name: Download nargo binary |
| 61 | + uses: actions/download-artifact@v4 |
| 62 | + with: |
| 63 | + name: nargo |
| 64 | + path: ./nargo |
| 65 | + |
| 66 | + - name: Set nargo on PATH |
| 67 | + run: | |
| 68 | + nargo_binary="${{ github.workspace }}/nargo/nargo" |
| 69 | + chmod +x $nargo_binary |
| 70 | + echo "$(dirname $nargo_binary)" >> $GITHUB_PATH |
| 71 | + export PATH="$PATH:$(dirname $nargo_binary)" |
| 72 | + nargo -V |
| 73 | +
|
| 74 | + - name: Generate gates report |
| 75 | + working-directory: ./test_programs |
| 76 | + run: | |
| 77 | + ./rebuild.sh |
| 78 | + ./gates_report.sh |
| 79 | + mv gates_report.json ../gates_report.json |
74 | 80 | |
75 | | -# - name: Compare gates reports |
76 | | -# id: gates_diff |
77 | | -# uses: vezenovm/noir-gates-diff@acf12797860f237117e15c0d6e08d64253af52b6 |
78 | | -# with: |
79 | | -# report: gates_report.json |
80 | | -# summaryQuantile: 0.9 # only display the 10% most significant circuit size diffs in the summary (defaults to 20%) |
81 | | - |
82 | | -# - name: Add gates diff to sticky comment |
83 | | -# if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target' |
84 | | -# uses: marocchino/sticky-pull-request-comment@v2 |
85 | | -# with: |
86 | | -# # delete the comment in case changes no longer impact circuit sizes |
87 | | -# delete: ${{ !steps.gates_diff.outputs.markdown }} |
88 | | -# message: ${{ steps.gates_diff.outputs.markdown }} |
| 81 | + - name: Compare gates reports |
| 82 | + id: gates_diff |
| 83 | + uses: vezenovm/noir-gates-diff@acf12797860f237117e15c0d6e08d64253af52b6 |
| 84 | + with: |
| 85 | + report: gates_report.json |
| 86 | + summaryQuantile: 0.9 # only display the 10% most significant circuit size diffs in the summary (defaults to 20%) |
| 87 | + |
| 88 | + - name: Add gates diff to sticky comment |
| 89 | + if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target' |
| 90 | + uses: marocchino/sticky-pull-request-comment@v2 |
| 91 | + with: |
| 92 | + # delete the comment in case changes no longer impact circuit sizes |
| 93 | + delete: ${{ !steps.gates_diff.outputs.markdown }} |
| 94 | + message: ${{ steps.gates_diff.outputs.markdown }} |
0 commit comments