|
| 1 | +name: Build |
| 2 | +on: { pull_request: { branches: [main]}} |
| 3 | +env: |
| 4 | + OCAML_VERSION: 4.14.0 |
| 5 | +jobs: |
| 6 | + |
| 7 | + build: |
| 8 | + name: Build (Node.JS ${{ matrix.node_version }}) |
| 9 | + runs-on: ubuntu-22.04 |
| 10 | + strategy: |
| 11 | + matrix: |
| 12 | + node_version: [20, 22] |
| 13 | + steps: |
| 14 | + - name: Checkout Repository |
| 15 | + uses: actions/checkout@v4 |
| 16 | + with: |
| 17 | + submodules: recursive |
| 18 | + |
| 19 | + - name: apt, apt |
| 20 | + run: | |
| 21 | + set -Eeuxo pipefail |
| 22 | + export DEBIAN_FRONTEND=noninteractive |
| 23 | + sudo apt update |
| 24 | + sudo apt install --no-install-recommends --yes \ |
| 25 | + libboost-dev \ |
| 26 | + libboost-program-options-dev \ |
| 27 | + libbz2-dev \ |
| 28 | + libcap-dev \ |
| 29 | + libffi-dev \ |
| 30 | + libgflags-dev \ |
| 31 | + libgmp-dev \ |
| 32 | + libgmp3-dev \ |
| 33 | + libjemalloc-dev \ |
| 34 | + liblmdb-dev \ |
| 35 | + liblmdb0 \ |
| 36 | + libpq-dev \ |
| 37 | + libprocps-dev \ |
| 38 | + libsodium-dev \ |
| 39 | + libssl-dev \ |
| 40 | + build-essential \ |
| 41 | + ca-certificates \ |
| 42 | + capnproto \ |
| 43 | + cmake \ |
| 44 | + curl \ |
| 45 | + file \ |
| 46 | + git \ |
| 47 | + git-lfs \ |
| 48 | + m4 \ |
| 49 | + pkg-config \ |
| 50 | + rsync \ |
| 51 | + sudo \ |
| 52 | + unzip \ |
| 53 | + binaryen \ |
| 54 | + zlib1g-dev |
| 55 | + |
| 56 | + - name: Setup Node.JS ${{ matrix.node_version }} |
| 57 | + uses: actions/setup-node@v4 |
| 58 | + with: |
| 59 | + node-version: ${{ matrix.node_version }} |
| 60 | + |
| 61 | + - name: Install Dependencies |
| 62 | + run: npm ci |
| 63 | + |
| 64 | + - name: Set-up OCaml ${{ env.OCAML_VERSION }} |
| 65 | + uses: ocaml/setup-ocaml@v3 |
| 66 | + with: |
| 67 | + ocaml-compiler: ${{ env.OCAML_VERSION }} |
| 68 | + |
| 69 | + - name: Pin opam dependencies |
| 70 | + run: | |
| 71 | + set -Eeuxo pipefail |
| 72 | + opam repository set-url default https://github.com/ocaml/opam-repository.git\#08d8c16c16dc6b23a5278b06dff0ac6c7a217356 |
| 73 | + opam repository add --yes --all --set-default o1-labs https://github.com/o1-labs/opam-repository.git |
| 74 | +
|
| 75 | + - name: Cache opam switch |
| 76 | + id: cache-opam |
| 77 | + uses: actions/cache@v4 |
| 78 | + with: |
| 79 | + path: ./_opam/ |
| 80 | + key: ${{ runner.os }}-${{ env.OCAML_VERSION }}-${{ hashFiles('./src/mina/opam.export') }} |
| 81 | + |
| 82 | + - name: Setup opam switch |
| 83 | + if: steps.cache-opam.outputs.cache-hit != 'true' |
| 84 | + run: | |
| 85 | + set -Eeuxo pipefail |
| 86 | +
|
| 87 | + pushd src/mina |
| 88 | + opam switch import opam.export |
| 89 | + |
| 90 | + - name: Debug opam switch |
| 91 | + if: steps.cache-opam.outputs.cache-hit == 'true' |
| 92 | + run: | |
| 93 | + set -Eeuxo pipefail |
| 94 | + eval $(opam env) |
| 95 | + opam switch |
| 96 | + which dune |
| 97 | + |
| 98 | + - name: Setup rust toolchain |
| 99 | + uses: actions-rust-lang/setup-rust-toolchain@v1 |
| 100 | + with: |
| 101 | + toolchain: nightly-2024-09-05 |
| 102 | + target: wasm32-unknown-unknown |
| 103 | + |
| 104 | + - name: Setup rust toolchain again |
| 105 | + run: rustup component add rust-src --toolchain nightly-2024-09-05-x86_64-unknown-linux-gnu |
| 106 | + |
| 107 | + - name: Setup go |
| 108 | + uses: actions/setup-go@v6 |
| 109 | + with: |
| 110 | + go-version: 1.18.10 |
| 111 | + |
| 112 | + - name: Build bindings |
| 113 | + run: | |
| 114 | + eval $(opam env) |
| 115 | + npm run build:bindings-all |
| 116 | + |
| 117 | + - name: Build |
| 118 | + run: npm run build |
| 119 | + |
| 120 | + - name: Run simple test |
| 121 | + env: |
| 122 | + TEST_TYPE: "Simple integration tests" |
| 123 | + run: ./run-ci-tests.sh |
| 124 | + timeout-minutes: 30 |
| 125 | + |
0 commit comments