forked from defi-wonderland/aztec-standards
-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (93 loc) · 3.82 KB
/
Copy pathpr-checks.yml
File metadata and controls
102 lines (93 loc) · 3.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: PR Checks
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
# Job-level gating (not workflow-level `paths:`) so a skipped benchmark still
# reports as passing for branch protection.
changes:
name: Changes
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
benchmark: ${{ steps.filter.outputs.benchmark }}
steps:
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: filter
with:
filters: |
benchmark:
- 'src/**/*.nr'
- '**/Nargo.toml'
- 'benchmarks/**'
# every benchmark imports its setup helpers from this file
- 'src/ts/test/utils.ts'
- 'tsconfig.json'
- 'package.json'
- 'yarn.lock'
- '.github/workflows/pr-checks.yml'
format:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: '22'
cache: 'yarn'
- run: yarn install --frozen-lockfile
- run: yarn format:check
checks:
uses: AztecProtocol/aztec-ci-actions/.github/workflows/run-tests.yml@431859e477234b8690eb1f80d1305d2e34f10f1b # v0.1.1
with:
runner: ubuntu-latest
# JS tests run in the `js-tests` job below instead, which needs a job-level env var
# that a reusable workflow cannot inherit from its caller.
run-js-tests: false
secrets: inherit
# Mirrors the `js-tests` job of aztec-ci-actions/run-tests.yml, inlined for one reason:
# SEQ_BLOCK_DURATION_MS below. Reusable workflows do not inherit the caller's `env`, and
# run-tests.yml exposes no knob for it, so the only way to reach the node is to own the job.
js-tests:
name: JS Tests
runs-on: ubuntu-latest
timeout-minutes: 60
env:
# `aztec start --local-network` defaults to 3s blocks. With 72s slots that is 21 blocks per
# checkpoint, and the per-tx DA admission limit is ceil(budget / blocks * 1.5) = 55,882.
# Mainnet runs 6s blocks (10 blocks per checkpoint -> 117,668); the protocol picks that
# multiplier precisely so "a maximal contract class registration (~97k DA gas) fits a single
# block under v5 mainnet geometry" (aztec stdlib, gas/tx_gas_limits.ts).
#
# Publishing the Vault contract class costs ~64k DA gas: comfortably valid on mainnet and
# under the ~97k the protocol guarantees, but rejected by the default local geometry. Pinning
# 6s blocks makes CI reproduce mainnet rather than a network stricter than the one we ship to.
SEQ_BLOCK_DURATION_MS: '6000'
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
fetch-depth: 0
- name: Setup Aztec environment
uses: AztecProtocol/aztec-ci-actions/actions/setup-aztec@431859e477234b8690eb1f80d1305d2e34f10f1b # v0.1.1
with:
start-pxe: 'true'
run-codegen: 'true'
- name: Run JS tests
uses: AztecProtocol/aztec-ci-actions/actions/js-tests@431859e477234b8690eb1f80d1305d2e34f10f1b # v0.1.1
benchmark:
# Skipping also skips this branch's baseline-artifact upload; a PR stacked on
# top of a skipped branch falls back to `if_no_artifact_found: warn` downstream.
needs: changes
if: needs.changes.outputs.benchmark == 'true'
uses: AztecProtocol/aztec-benchmark/.github/workflows/pr-benchmark.yml@39244c9306f7b460aec570297100f3513f7ef936 # v5.0.1
with:
runner: ubuntu-latest
permissions:
contents: read
pull-requests: write
issues: write
actions: read
secrets: inherit