-
Notifications
You must be signed in to change notification settings - Fork 172
163 lines (146 loc) · 4.55 KB
/
build.yml
File metadata and controls
163 lines (146 loc) · 4.55 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
name: Build
on:
pull_request:
workflow_dispatch:
env:
OCAML_VERSION: 4.14.2
jobs:
build:
name: '[${{ matrix.os }}] Build (Node.JS ${{ matrix.node_version }})'
strategy:
matrix:
os: [
ubuntu-latest,
macos-latest,
]
node_version: [22, 24]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Homebrew
if: runner.os == 'macOS'
uses: Homebrew/actions/setup-homebrew@f4b81a54c655301a8039231c1ae08f89714fe245
- name: Install Homebrew dependencies
if: runner.os == 'macOS'
env:
HOMEBREW_NO_AUTO_UPDATE: 1
run: |
brew install \
capnp \
binaryen \
bzip2 \
gnu-sed \
libffi \
libpq \
libsodium \
lmdb \
pkgconf \
postgresql@15 \
wasm-pack \
wasm-tools \
wabt \
bash \
boost \
cmake \
gmp \
gpatch \
jemalloc \
libomp
brew link postgresql@15
- name: Install apt dependencies
if: runner.os == 'Linux'
run: |
set -Eeuxo pipefail
export DEBIAN_FRONTEND=noninteractive
sudo apt update
sudo apt install --no-install-recommends --yes \
libboost-dev \
libboost-program-options-dev \
libbz2-dev \
libcap-dev \
libffi-dev \
libgflags-dev \
libgmp-dev \
libgmp3-dev \
libjemalloc-dev \
liblmdb-dev \
liblmdb0 \
libpq-dev \
libsodium-dev \
libssl-dev \
build-essential \
ca-certificates \
capnproto \
cmake \
curl \
file \
git \
git-lfs \
m4 \
pkg-config \
rsync \
sudo \
unzip \
binaryen \
zlib1g-dev
- name: Setup Node.JS ${{ matrix.node_version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
- name: Install Dependencies
run: npm ci
- name: Set-up OCaml ${{ env.OCAML_VERSION }}
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: ${{ env.OCAML_VERSION }}
- name: Cache opam switch
id: cache-opam
uses: actions/cache@v4
with:
path: ./_opam/
key: ${{ runner.os }}-${{ env.OCAML_VERSION }}-${{ hashFiles('./src/mina/opam.export') }}
- name: Setup opam switch
if: steps.cache-opam.outputs.cache-hit != 'true'
run: |
set -Eeuxo pipefail
if [[ "${{ runner.os }}" == "macOS" ]]; then
export CFLAGS="-I/opt/homebrew/include/"
export CPPFLAGS="-I/opt/homebrew/include/"
export C_INCLUDE_PATH="/opt/homebrew/include/"
export LDFLAGS="-L/opt/homebrew/lib/"
export PKG_CONFIG_PATH="$(brew --prefix libpq)/lib/pkgconfig:$(brew --prefix libsodium)/lib/pkgconfig"
fi
opam repository set-url default https://github.com/ocaml/opam-repository.git\#08d8c16c16dc6b23a5278b06dff0ac6c7a217356
opam repository add --yes --all --set-default o1-labs https://github.com/o1-labs/opam-repository.git
opam pin add --no-action async_ssl https://github.com/o1-labs/async_ssl.git\#v0.14-o1labs
pushd src/mina
opam switch import --debug --assume-depexts opam.export
- name: Setup rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2024-09-05
targets: wasm32-unknown-unknown
components: rust-src
- name: Setup go
uses: nicholasngai/actions-setup-go@f107e23d356886ae65af3bd7f30d8f6c56801c23
with:
go-version: 1.18.10
- name: Build bindings
run: |
if [[ "${{ runner.os }}" == "macOS" ]]; then
export RUST_TARGET_FEATURE_OPTIMISATIONS=omit
export PATH="$(brew --prefix gnu-sed)/libexec/gnubin:$PATH"
fi
eval $(opam env)
npm run build:bindings-all
- name: Build
run: npm run build
- name: Run simple test
env:
TEST_TYPE: 'Simple integration tests'
run: ./run-ci-tests.sh
timeout-minutes: 60