Skip to content

Commit 63ec194

Browse files
authored
Merge pull request #2188 from o1-labs/brian/proof-systems-test
2 parents 9ebc219 + f0c7ad2 commit 63ec194

File tree

3 files changed

+86
-9
lines changed

3 files changed

+86
-9
lines changed

.github/actions/build/action.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ description: 'All of the building steps for o1js'
44
permissions:
55
contents: write
66

7+
inputs:
8+
proof_systems_commit:
9+
description: 'proof_systems commit to use'
10+
required: false
11+
default: ''
12+
713
runs:
814
using: "composite"
915
steps:
@@ -22,16 +28,26 @@ runs:
2228
with:
2329
node-version: '20'
2430

31+
- name: use proof_systems_commit if provided
32+
if: ${{ inputs.proof_systems_commit != '' }}
33+
shell: bash
34+
run: |
35+
git -C src/mina/src/lib/crypto/proof-systems fetch origin ${{ inputs.proof_systems_commit }}
36+
git -C src/mina/src/lib/crypto/proof-systems clean -fdx
37+
git -C src/mina/src/lib/crypto/proof-systems checkout ${{ inputs.proof_systems_commit }}
38+
git -C src/mina/src/lib/crypto/proof-systems clean -fdx
39+
git -C src/mina add src/lib/crypto/proof-systems
40+
2541
- name: cache bindings
2642
uses: actions/cache@v4
2743
id: bindings-cache
2844
with:
2945
path: |
3046
src/bindings/compiled
3147
src/bindings/mina-transaction/gen
32-
key: bindings-${{ github.event.pull_request.head.sha || github.sha }}
48+
key: bindings-${{ github.event.pull_request.head.sha || github.sha }}-${{ inputs.proof_systems_commit }}
3349
- name: Build the o1js bindings
34-
if: steps.bindings-cache.outputs.cache-hit != 'true'
50+
if: ${{ steps.bindings-cache.outputs.cache-hit != 'true' }}
3551
shell: bash
3652
run: |
3753
set -Eeu
@@ -47,13 +63,13 @@ runs:
4763
dist
4864
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.ts', '**/*.js') }}
4965
- name: Build examples
50-
if: steps.cache.outputs.cache-hit != 'true'
66+
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
5167
shell: bash
5268
run: |
5369
npm ci
5470
npm run build:examples
5571
- name: Build o1js clean
56-
if: steps.cache.outputs.cache-hit != 'true'
72+
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
5773
shell: bash
5874
run: |
5975
rm -fr dist

.github/workflows/checks.yml

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,26 @@ on:
66
- develop
77
- v1
88
- v3
9-
pull_request:
10-
workflow_dispatch: {}
9+
pull_request: {}
10+
workflow_dispatch:
11+
inputs:
12+
proof_systems_commit:
13+
description: 'proof_systems commit to use'
14+
required: false
15+
default: ''
16+
workflow_call:
17+
inputs:
18+
proof_systems_commit:
19+
description: 'proof_systems commit to use'
20+
required: false
21+
type: string
22+
default: ''
23+
target_repo:
24+
required: false
25+
type: string
26+
target_ref:
27+
required: false
28+
type: string
1129

1230
concurrency:
1331
group: ${{ github.workflow }}-${{ github.ref }}
@@ -24,8 +42,14 @@ jobs:
2442
uses: actions/checkout@v4
2543
with:
2644
submodules: recursive
45+
repository: ${{ inputs.target_repo || github.repository }}
46+
ref: ${{ inputs.target_ref || github.ref }}
2747
- name: Build
2848
uses: ./.github/actions/build
49+
with:
50+
repository: ${{ inputs.target_repo || github.repository }}
51+
ref: ${{ inputs.target_ref || github.ref }}
52+
proof_systems_commit: ${{ inputs.proof_systems_commit }}
2953

3054
Lint-Format-and-TypoCheck:
3155
strategy:
@@ -37,6 +61,9 @@ jobs:
3761
steps:
3862
- name: Checkout Repository
3963
uses: actions/checkout@v4
64+
with:
65+
repository: ${{ inputs.target_repo || github.repository }}
66+
ref: ${{ inputs.target_ref || github.ref }}
4067
- name: Setup Node.JS ${{ matrix.node }}
4168
uses: actions/setup-node@v4
4269
with:
@@ -81,12 +108,15 @@ jobs:
81108

82109
Upload-bindings:
83110
name: upload bindings artifact
111+
if: ${{ inputs.proof_systems_commit == '' }}
84112
needs: [Prepare]
85113
runs-on: ubuntu-latest
86114
steps:
87115
- uses: actions/checkout@v4
88116
with:
89117
submodules: recursive
118+
repository: ${{ inputs.target_repo || github.repository }}
119+
ref: ${{ inputs.target_ref || github.ref }}
90120
- name: upload
91121
uses: ./.github/actions/upload
92122
with:
@@ -117,9 +147,15 @@ jobs:
117147
uses: actions/checkout@v4
118148
with:
119149
submodules: recursive
150+
repository: ${{ inputs.target_repo || github.repository }}
151+
ref: ${{ inputs.target_ref || github.ref }}
120152

121153
- name: build
122154
uses: ./.github/actions/build
155+
with:
156+
repository: ${{ inputs.target_repo || github.repository }}
157+
ref: ${{ inputs.target_ref || github.ref }}
158+
proof_systems_commit: ${{ inputs.proof_systems_commit }}
123159
- name: Prepare for tests
124160
run: touch profiling.md
125161
- name: Execute tests
@@ -146,8 +182,14 @@ jobs:
146182
uses: actions/checkout@v4
147183
with:
148184
submodules: recursive
185+
repository: ${{ inputs.target_repo || github.repository }}
186+
ref: ${{ inputs.target_ref || github.ref }}
149187
- name: build
150188
uses: ./.github/actions/build
189+
with:
190+
repository: ${{ inputs.target_repo || github.repository }}
191+
ref: ${{ inputs.target_ref || github.ref }}
192+
proof_systems_commit: ${{ inputs.proof_systems_commit }}
151193
- name: Count tests
152194
id: count_tests
153195
run: |
@@ -279,8 +321,15 @@ jobs:
279321
steps:
280322
- name: Checkout repository
281323
uses: actions/checkout@v4
324+
with:
325+
repository: ${{ inputs.target_repo || github.repository }}
326+
ref: ${{ inputs.target_ref || github.ref }}
282327
- name: build
283328
uses: ./.github/actions/build
329+
with:
330+
repository: ${{ inputs.target_repo || github.repository }}
331+
ref: ${{ inputs.target_ref || github.ref }}
332+
proof_systems_commit: ${{ inputs.proof_systems_commit }}
284333
- name: Use shared steps for live testing jobs
285334
uses: ./.github/actions/live-tests-shared
286335
with:
@@ -307,8 +356,15 @@ jobs:
307356
steps:
308357
- name: Checkout repository
309358
uses: actions/checkout@v4
359+
with:
360+
repository: ${{ inputs.target_repo || github.repository }}
361+
ref: ${{ inputs.target_ref || github.ref }}
310362
- name: build
311363
uses: ./.github/actions/build
364+
with:
365+
repository: ${{ inputs.target_repo || github.repository }}
366+
ref: ${{ inputs.target_ref || github.ref }}
367+
proof_systems_commit: ${{ inputs.proof_systems_commit }}
312368
- name: Use shared steps for live testing jobs
313369
uses: ./.github/actions/live-tests-shared
314370
with:

.github/workflows/pull_requests.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,20 @@ jobs:
1515

1616
Check-npm-deps:
1717
name: Check npmDepsHash is correct
18-
runs-on: [sdk-self-hosted-linux-amd64-build-system]
18+
runs-on: ubuntu-latest
1919
steps:
20-
- name: Set up Nix
21-
run: echo "PATH=$PATH:/nix/var/nix/profiles/default/bin" >> $GITHUB_ENV
2220
- name: Disable smudging
2321
run: echo "GIT_LFS_SKIP_SMUDGE=1" >> $GITHUB_ENV
2422
- uses: actions/checkout@v4
2523
with:
2624
submodules: recursive
25+
- uses: nixbuild/nix-quick-install-action@v30
26+
continue-on-error: true
27+
with:
28+
nix_conf: |
29+
keep-env-derivations = true
30+
keep-outputs = true
31+
require-sigs = false
2732
- name: fix npmDepsHash
2833
run: |
2934
set -Eeu

0 commit comments

Comments
 (0)