Skip to content

Commit 83dc4f4

Browse files
committed
merge main
2 parents 5ea62bb + 58e6723 commit 83dc4f4

File tree

115 files changed

+18660
-160
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+18660
-160
lines changed

.github/workflows/build-action.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,20 @@ jobs:
3232
uses: actions/setup-node@v4
3333
with:
3434
node-version: '20'
35-
35+
- name: Wait for bindings-cache
36+
uses: fountainhead/action-wait-for-check@5a908a24814494009c4bb27c242ea38c93c593be
37+
with:
38+
checkName: "build-bindings-ubuntu"
39+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
40+
token: ${{ secrets.GITHUB_TOKEN }}
41+
- name: Restore bindings-cache
42+
uses: actions/cache@v4
43+
with:
44+
path: |
45+
src/bindings/compiled
46+
src/bindings/mina-transaction/gen
47+
key: bindings-${{ github.event.pull_request.head.sha || github.sha }}
48+
fail-on-cache-miss: true
3649
- name: Cache dependencies and build
3750
uses: actions/cache@v4
3851
id: cache
@@ -328,14 +341,14 @@ jobs:
328341
git tag $RELEASED_VERSION
329342
git push origin $RELEASED_VERSION
330343
- name: Create Release
331-
uses: ncipollo/release-action@v1
344+
uses: ncipollo/release-action@440c8c1cb0ed28b9f43e4d1d670870f059653174
332345
if: success()
333346
with:
334347
token: ${{ secrets.GITHUB_TOKEN }}
335348
tag: ${{ steps.publish.outputs.version }}
336349
generateReleaseNotes: true
337350
name: Release ${{ steps.publish.outputs.version }}
338-
351+
skipIfReleaseExists: true
339352

340353
Release-mina-signer-on-NPM:
341354
if: github.ref == 'refs/heads/main'

.github/workflows/build-bindings.yml

Lines changed: 44 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,20 @@
22
# community can change them without being scared of breaking things, or
33
# needing to do the complicated (without nix) build setup.
44

5-
name: Build o1js bindings
5+
name: Build bindings
66

77
on:
88
pull_request:
9+
workflow_dispatch:
910

1011
concurrency:
1112
group: ${{ github.workflow }}-${{ github.ref }}
1213
cancel-in-progress: true
1314

1415
jobs:
1516
check-npm-deps:
16-
name: check-npm-deps
17+
if: github.event_name == 'pull_request' # Runs only for PRs
18+
name: check npmDepsHash is correct
1719
runs-on: [sdk-self-hosted-linux-amd64-build-system]
1820
steps:
1921
- name: Set up Nix
@@ -23,24 +25,17 @@ jobs:
2325
- uses: actions/checkout@v4
2426
with:
2527
submodules: recursive
26-
- name: Try to build
28+
- name: fix npmDepsHash
2729
run: |
2830
set -Eeu
2931
./pin.sh
30-
nix build o1js#npm-deps
31-
update-npm-deps:
32-
needs: check-npm-deps
33-
if: ${{ failure() }}
34-
runs-on: [sdk-self-hosted-linux-amd64-build-system]
35-
steps:
36-
- name: Set up Nix
37-
run: echo "PATH=$PATH:/nix/var/nix/profiles/default/bin" >> $GITHUB_ENV
38-
- name: update-hash
39-
run: nix run o1js#update-npm-deps
40-
- uses: parkerbxyz/suggest-changes@v1
32+
nix run o1js#update-npm-deps
33+
# if the npmDepsHash is out of date auto commit the new one
34+
- uses: stefanzweifel/git-auto-commit-action@v5
4135
with:
42-
comment: 'please update the npm-deps-hash'
43-
event: 'REQUEST_CHANGES'
36+
commit_message: "auto update npmDepsHash"
37+
file_pattern: "npmDepsHash"
38+
4439

4540
nix-build:
4641
name: build-bindings-ubuntu
@@ -57,32 +52,42 @@ jobs:
5752
run: |
5853
set -Eeu
5954
./pin.sh
60-
nix run o1js#update-bindings --max-jobs 4
61-
#fail if this changes any files
62-
cd src/bindings
63-
echo If this check fails you can download a patch from the patch-upload job
64-
echo "https://github.com/o1-labs/o1js/blob/main/README-dev.md#bindings-check-in-ci"
65-
git diff --exit-code
66-
- name: add build to gc-root if on main
67-
if: github.ref == 'refs/heads/main'
68-
run: |
69-
nix build o1js#o1js-bindings --out-link /home/app/actions-runner/nix-cache/main-bindings-gcroot
70-
- name: Cleanup the Nix store
71-
run: |
72-
nix-store --gc --print-dead
73-
nix-store --optimise
74-
patch-upload:
55+
nix run o1js#generate-bindings --max-jobs 4
56+
- name: cache bindings
57+
uses: actions/cache@v4
58+
id: bindings-cache
59+
with:
60+
path: |
61+
src/bindings/compiled
62+
src/bindings/mina-transaction/gen
63+
key: bindings-${{ github.event.pull_request.head.sha || github.sha }}
64+
65+
# The upload job is seperate from the build job because
66+
# other workflows have to wait for the cache and the await action works with jobs not steps
67+
# so the split is nesecary to avoid waiting for the artifact upload too
68+
upload-bindings:
69+
name: upload bindings artifact
7570
needs: nix-build
76-
if: ${{ failure() }}
7771
runs-on: [sdk-self-hosted-linux-amd64-build-system]
7872
steps:
79-
- name: generate patch
73+
- name: Set up Nix
74+
run: echo "PATH=$PATH:/nix/var/nix/profiles/default/bin" >> $GITHUB_ENV
75+
- name: Disable smudging
76+
run: echo "GIT_LFS_SKIP_SMUDGE=1" >> $GITHUB_ENV
77+
- uses: actions/checkout@v4
78+
with:
79+
submodules: recursive
80+
- name: generate tar
8081
run: |
81-
cd src/bindings
82-
git add .
83-
git diff HEAD --textconv --text > ../../bindings.patch
84-
- name: Upload patch
82+
set -Eeu
83+
./pin.sh
84+
nix build o1js#bindings-tar --out-link bindings.tar.gz
85+
- name: Upload bindings
8586
uses: actions/upload-artifact@v4
8687
with:
87-
name: bindings.patch
88-
path: bindings.patch
88+
name: bindings.tar.gz
89+
path: bindings.tar.gz
90+
- name: add build to gc-root if on main
91+
if: github.ref == 'refs/heads/main'
92+
run: |
93+
nix build o1js#o1js-bindings --out-link /home/app/actions-runner/nix-cache/main-bindings-gcroot

.github/workflows/doc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
npm ci
2525
npx typedoc --tsconfig tsconfig.node.json src/index.ts
2626
- name: Deploy
27-
uses: peaceiris/actions-gh-pages@v3
27+
uses: peaceiris/actions-gh-pages@373f7f263a76c20808c831209c920827a82a2847
2828
with:
2929
github_token: ${{ secrets.GITHUB_TOKEN }}
3030
publish_dir: ./docs

.github/workflows/lint.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ jobs:
2828
id: get_changed_files
2929
run: |
3030
git fetch origin main --depth=1
31-
CHANGED_FILES=$(git diff --name-only origin/main | grep -E '\.(ts|js)$' || true)
32-
31+
# TODO ideally lint the non-generated files in src/bindings/
32+
CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.ref }} | grep -E '\.(ts|js)$' | grep -v 'src/bindings/*' || true)
33+
3334
if [ -n "$CHANGED_FILES" ]; then
3435
echo "Files changed:"
3536
echo "$CHANGED_FILES"

.github/workflows/live-tests.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,20 @@ jobs:
3737
steps:
3838
- name: Checkout repository
3939
uses: actions/checkout@v4
40+
- name: Wait for bindings-cache
41+
uses: fountainhead/action-wait-for-check@5a908a24814494009c4bb27c242ea38c93c593be
42+
with:
43+
checkName: "build-bindings-ubuntu"
44+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
45+
token: ${{ secrets.GITHUB_TOKEN }}
46+
- name: Restore bindings-cache
47+
uses: actions/cache@v4
48+
with:
49+
path: |
50+
src/bindings/compiled
51+
src/bindings/mina-transaction/gen
52+
key: bindings-${{ github.event.pull_request.head.sha || github.sha }}
53+
fail-on-cache-miss: true
4054
- name: Use shared steps for live testing jobs
4155
uses: ./.github/actions/live-tests-shared
4256
with:
@@ -61,6 +75,20 @@ jobs:
6175
steps:
6276
- name: Checkout repository
6377
uses: actions/checkout@v4
78+
- name: Wait for bindings-cache
79+
uses: fountainhead/action-wait-for-check@5a908a24814494009c4bb27c242ea38c93c593be
80+
with:
81+
checkName: "build-bindings-ubuntu"
82+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
83+
token: ${{ secrets.GITHUB_TOKEN }}
84+
- name: Restore bindings-cache
85+
uses: actions/cache@v4
86+
with:
87+
path: |
88+
src/bindings/compiled
89+
src/bindings/mina-transaction/gen
90+
key: bindings-${{ github.event.pull_request.head.sha || github.sha }}
91+
fail-on-cache-miss: true
6492
- name: Use shared steps for live testing jobs
6593
uses: ./.github/actions/live-tests-shared
6694
with:

.github/workflows/nightly.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Nightly
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *' # once per day at midnight
6+
workflow_dispatch: # can be run with gh workflow run 'Clean nix store'
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
# This is the slowest part of the CI now so I think it's better to just do it daily
14+
# instead of every commit
15+
nix-cleanup:
16+
runs-on: [sdk-self-hosted-linux-amd64-build-system]
17+
steps:
18+
- name: Set up Nix
19+
run: echo "PATH=$PATH:/nix/var/nix/profiles/default/bin" >> $GITHUB_ENV
20+
- name: Cleanup the Nix store
21+
run: |
22+
nix-store --gc
23+
nix-store --optimise
24+

.github/workflows/nix.yml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,19 @@
11
name: nix
22
on:
33
workflow_dispatch:
4-
inputs:
5-
name:
6-
description: 'Commit nix fixes'
7-
default: 'World'
8-
required: true
94

105
concurrency:
116
group: ${{ github.workflow }}-${{ github.ref }}
127
cancel-in-progress: true
138

149
jobs:
15-
nix-fixes:
10+
nix-cleanup:
1611
runs-on: [sdk-self-hosted-linux-amd64-build-system]
1712
steps:
1813
- name: Set up Nix
1914
run: echo "PATH=$PATH:/nix/var/nix/profiles/default/bin" >> $GITHUB_ENV
20-
- name: Disable smudging
21-
run: echo "GIT_LFS_SKIP_SMUDGE=1" >> $GITHUB_ENV
22-
- uses: actions/checkout@v4
23-
with:
24-
submodules: recursive
15+
- name: Cleanup the Nix store
16+
run: |
17+
nix-store --gc
18+
nix-store --optimise
19+

.github/workflows/pkg-pr-new-publish.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ jobs:
2424
uses: actions/setup-node@v4
2525
with:
2626
node-version: ${{ matrix.node }}
27+
- name: download bindings
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
run: ./src/bindings/scripts/download-bindings.sh
2731
- name: Build o1js and mina-signer
2832
run: |
2933
GIT_LFS_SKIP_SMUDGE=1 git submodule update --init --recursive

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ src/config.mlh
1313
.direnv
1414
.rustup
1515
result
16+
# precompiled bindings
17+
src/bindings/compiled
18+
.bindings_download

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
[submodule "src/o1js-bindings"]
2-
path = src/bindings
3-
url = https://github.com/o1-labs/o1js-bindings.git
41
[submodule "src/mina"]
52
path = src/mina
63
url = https://github.com/MinaProtocol/mina.git

0 commit comments

Comments
 (0)