-
Notifications
You must be signed in to change notification settings - Fork 172
93 lines (86 loc) · 3.06 KB
/
build-bindings.yml
File metadata and controls
93 lines (86 loc) · 3.06 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
# Purpose: We want to build the o1js bindings in CI so that people in the
# community can change them without being scared of breaking things, or
# needing to do the complicated (without nix) build setup.
name: Build bindings
on:
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check-npm-deps:
if: github.event_name == 'pull_request' # Runs only for PRs
name: check npmDepsHash is correct
runs-on: [sdk-self-hosted-linux-amd64-build-system]
steps:
- name: Set up Nix
run: echo "PATH=$PATH:/nix/var/nix/profiles/default/bin" >> $GITHUB_ENV
- name: Disable smudging
run: echo "GIT_LFS_SKIP_SMUDGE=1" >> $GITHUB_ENV
- uses: actions/checkout@v4
with:
submodules: recursive
- name: fix npmDepsHash
run: |
set -Eeu
./pin.sh
nix run o1js#update-npm-deps
# if the npmDepsHash is out of date auto commit the new one
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "auto update npmDepsHash"
file_pattern: "npmDepsHash"
nix-build:
name: build-bindings-ubuntu
runs-on: [sdk-self-hosted-linux-amd64-build-system]
steps:
- name: Set up Nix
run: echo "PATH=$PATH:/nix/var/nix/profiles/default/bin" >> $GITHUB_ENV
- name: Disable smudging
run: echo "GIT_LFS_SKIP_SMUDGE=1" >> $GITHUB_ENV
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Build the o1js bindings
run: |
set -Eeu
./pin.sh
nix run o1js#generate-bindings --max-jobs 4
- name: cache bindings
uses: actions/cache@v4
id: bindings-cache
with:
path: |
src/bindings/compiled
src/bindings/mina-transaction/gen
key: bindings-${{ github.event.pull_request.head.sha || github.sha }}
# The upload job is separate from the build job because
# other workflows have to wait for the cache and the await action works with jobs not steps
# so the split is nesecary to avoid waiting for the artifact upload too
upload-bindings:
name: upload bindings artifact
needs: nix-build
runs-on: [sdk-self-hosted-linux-amd64-build-system]
steps:
- name: Set up Nix
run: echo "PATH=$PATH:/nix/var/nix/profiles/default/bin" >> $GITHUB_ENV
- name: Disable smudging
run: echo "GIT_LFS_SKIP_SMUDGE=1" >> $GITHUB_ENV
- uses: actions/checkout@v4
with:
submodules: recursive
- name: generate tar
run: |
set -Eeu
./pin.sh
nix build o1js#bindings-tar --out-link bindings.tar.gz
- name: Upload bindings
uses: actions/upload-artifact@v4
with:
name: bindings.tar.gz
path: bindings.tar.gz
- name: add build to gc-root if on main
if: github.ref == 'refs/heads/main'
run: |
nix build o1js#o1js-bindings --out-link /home/app/actions-runner/nix-cache/main-bindings-gcroot