Skip to content

Commit fcad3fa

Browse files
native build workflow
1 parent 346479a commit fcad3fa

File tree

3 files changed

+185
-4
lines changed

3 files changed

+185
-4
lines changed

.config/cspell.json

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@
3535
"cachedir",
3636
"callforest",
3737
"caml",
38+
"capnp",
39+
"capnproto",
3840
"Cfgs",
41+
"CFLAGS",
3942
"Chal",
4043
"chals",
4144
"coeff",
@@ -48,6 +51,7 @@
4851
"conv",
4952
"CPPFLAGS",
5053
"ctypes",
54+
"depexts",
5155
"descr",
5256
"devnet",
5357
"devshell",
@@ -58,6 +62,7 @@
5862
"doccomments",
5963
"docstrings",
6064
"dont",
65+
"dtolnay",
6166
"dxdy",
6267
"dynlink",
6368
"eddsa",
@@ -96,6 +101,7 @@
96101
"Freeable",
97102
"Fseqp",
98103
"gitmodules",
104+
"gpatch",
99105
"gretke's",
100106
"hardfork",
101107
"Hlist",
@@ -111,6 +117,7 @@
111117
"Intfs",
112118
"Iseconds",
113119
"iteri",
120+
"jemalloc",
114121
"jslib",
115122
"jsoo",
116123
"jsstring",
@@ -121,12 +128,20 @@
121128
"LDFLAGS",
122129
"LEFTSHIFT",
123130
"lessthan",
131+
"libbz",
132+
"libgflags",
133+
"libgmp",
124134
"libiconv",
135+
"libjemalloc",
136+
"liblmdb",
137+
"libomp",
138+
"libpq",
125139
"libsodium",
126140
"liconv",
127141
"Lightnet",
128142
"lincom",
129143
"linkall",
144+
"lmdb",
130145
"loglog",
131146
"LuffySama",
132147
"maht",
@@ -143,6 +158,7 @@
143158
"modul",
144159
"Muls",
145160
"Nexts",
161+
"nicholasngai",
146162
"nixbuild",
147163
"nixfmt",
148164
"nixos",
@@ -155,6 +171,7 @@
155171
"offchain",
156172
"opam",
157173
"Optdef",
174+
"OPTIMISATIONS",
158175
"optimise",
159176
"optimised",
160177
"optin",
@@ -186,6 +203,7 @@
186203
"revspec",
187204
"RIGHTSHIFT",
188205
"rimraf",
206+
"Rminus",
189207
"rnew",
190208
"rngs",
191209
"rotr",
@@ -194,7 +212,6 @@
194212
"RUSTDIR",
195213
"rustlib",
196214
"rustup",
197-
"Rminus",
198215
"SBOX",
199216
"Schnorr",
200217
"Schönhage",
@@ -232,23 +249,24 @@
232249
"tweakable",
233250
"twoadic",
234251
"twoadicity",
252+
"uints",
235253
"underconstraint",
236254
"underflowed",
237255
"underflows",
238256
"unew",
239-
"uints",
240-
"untar",
241257
"unhash",
242258
"unhashing",
243259
"unintuitively",
244260
"unpackaging",
245261
"unreconstructable",
246262
"Unshifted",
263+
"untar",
247264
"Vanstone",
248265
"Varbase",
249266
"varfields",
250267
"verifys",
251268
"vnew",
269+
"wabt",
252270
"wasnt",
253271
"wbindgen",
254272
"Weierstraß",

.github/workflows/build.yml

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
name: Build
2+
on:
3+
pull_request:
4+
workflow_dispatch:
5+
env:
6+
OCAML_VERSION: 4.14.2
7+
jobs:
8+
build:
9+
name: '[${{ matrix.os }}] Build (Node.JS ${{ matrix.node_version }})'
10+
strategy:
11+
matrix:
12+
os: [
13+
ubuntu-latest,
14+
macos-latest,
15+
]
16+
node_version: [22, 24]
17+
fail-fast: false
18+
runs-on: ${{ matrix.os }}
19+
steps:
20+
- name: Checkout Repository
21+
uses: actions/checkout@v4
22+
with:
23+
submodules: recursive
24+
25+
- name: Set up Homebrew
26+
if: runner.os == 'macOS'
27+
uses: Homebrew/actions/setup-homebrew@f4b81a54c655301a8039231c1ae08f89714fe245
28+
29+
- name: Install Homebrew dependencies
30+
if: runner.os == 'macOS'
31+
env:
32+
HOMEBREW_NO_AUTO_UPDATE: 1
33+
run: |
34+
brew install \
35+
capnp \
36+
binaryen \
37+
bzip2 \
38+
gnu-sed \
39+
libffi \
40+
libpq \
41+
libsodium \
42+
lmdb \
43+
pkgconf \
44+
postgresql@15 \
45+
wasm-pack \
46+
wasm-tools \
47+
wabt \
48+
bash \
49+
boost \
50+
cmake \
51+
gmp \
52+
gpatch \
53+
jemalloc \
54+
libomp
55+
56+
brew link postgresql@15
57+
58+
- name: apt, apt
59+
if: runner.os == 'Linux'
60+
run: |
61+
set -Eeuxo pipefail
62+
export DEBIAN_FRONTEND=noninteractive
63+
sudo apt update
64+
sudo apt install --no-install-recommends --yes \
65+
libboost-dev \
66+
libboost-program-options-dev \
67+
libbz2-dev \
68+
libcap-dev \
69+
libffi-dev \
70+
libgflags-dev \
71+
libgmp-dev \
72+
libgmp3-dev \
73+
libjemalloc-dev \
74+
liblmdb-dev \
75+
liblmdb0 \
76+
libpq-dev \
77+
libsodium-dev \
78+
libssl-dev \
79+
build-essential \
80+
ca-certificates \
81+
capnproto \
82+
cmake \
83+
curl \
84+
file \
85+
git \
86+
git-lfs \
87+
m4 \
88+
pkg-config \
89+
rsync \
90+
sudo \
91+
unzip \
92+
binaryen \
93+
zlib1g-dev
94+
95+
- name: Setup Node.JS ${{ matrix.node_version }}
96+
uses: actions/setup-node@v4
97+
with:
98+
node-version: ${{ matrix.node_version }}
99+
100+
- name: Install Dependencies
101+
run: npm ci
102+
103+
- name: Set-up OCaml ${{ env.OCAML_VERSION }}
104+
uses: ocaml/setup-ocaml@v3
105+
with:
106+
ocaml-compiler: ${{ env.OCAML_VERSION }}
107+
108+
- name: Cache opam switch
109+
id: cache-opam
110+
uses: actions/cache@v4
111+
with:
112+
path: ./_opam/
113+
key: ${{ runner.os }}-${{ env.OCAML_VERSION }}-${{ hashFiles('./src/mina/opam.export') }}
114+
115+
- name: Setup opam switch
116+
if: steps.cache-opam.outputs.cache-hit != 'true'
117+
run: |
118+
set -Eeuxo pipefail
119+
120+
if [[ "${{ runner.os }}" == "macOS" ]]; then
121+
export CFLAGS="-I/opt/homebrew/include/"
122+
export CPPFLAGS="-I/opt/homebrew/include/"
123+
export C_INCLUDE_PATH="/opt/homebrew/include/"
124+
export LDFLAGS="-L/opt/homebrew/lib/"
125+
export PKG_CONFIG_PATH="$(brew --prefix libpq)/lib/pkgconfig:$(brew --prefix libsodium)/lib/pkgconfig"
126+
fi
127+
128+
opam repository set-url default https://github.com/ocaml/opam-repository.git\#08d8c16c16dc6b23a5278b06dff0ac6c7a217356
129+
opam repository add --yes --all --set-default o1-labs https://github.com/o1-labs/opam-repository.git
130+
opam pin add --no-action async_ssl https://github.com/o1-labs/async_ssl.git\#v0.14-o1labs
131+
pushd src/mina
132+
opam switch import --debug --assume-depexts opam.export
133+
134+
- name: Setup rust toolchain
135+
uses: dtolnay/rust-toolchain@master
136+
with:
137+
toolchain: nightly-2024-09-05
138+
targets: wasm32-unknown-unknown
139+
components: rust-src
140+
141+
- name: Setup go
142+
uses: nicholasngai/actions-setup-go@f107e23d356886ae65af3bd7f30d8f6c56801c23
143+
with:
144+
go-version: 1.18.10
145+
146+
- name: Build bindings
147+
run: |
148+
if [[ "${{ runner.os }}" == "macOS" ]]; then
149+
export RUST_TARGET_FEATURE_OPTIMISATIONS=omit
150+
export PATH="$(brew --prefix gnu-sed)/libexec/gnubin:$PATH"
151+
fi
152+
153+
eval $(opam env)
154+
npm run build:bindings-all
155+
156+
- name: Build
157+
run: npm run build
158+
159+
- name: Run simple test
160+
env:
161+
TEST_TYPE: 'Simple integration tests'
162+
run: ./run-ci-tests.sh
163+
timeout-minutes: 60

src/mina

0 commit comments

Comments
 (0)