cleanup(docker): try to reduce parallelism when building dune #153
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'OCaml tests' | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
name: Build | |
runs-on: '${{ matrix.os }}' | |
steps: | |
- name: 'Install deps' | |
run: bash -c '''case "$(uname)" in | |
(*Linux*) sudo apt update -y && sudo apt-get install -y libev-dev libssl-dev pkg-config; ;; | |
(*Darwin*) brew install libev openssl pkg-config; ;; | |
esac''' | |
- name: 'Checkout code' | |
uses: actions/checkout@v3 | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Cache Rust environment | |
uses: Swatinem/rust-cache@v1 | |
- id: wasmstore-opam-cache | |
name: 'OCaml/Opam cache' | |
uses: actions/cache@v3 | |
with: | |
key: 'wasmstore-opam-${{ matrix.ocaml-compiler }}-${{ matrix.os }}' | |
path: ~/.opam | |
- id: wasmstore-dune-cache | |
name: 'OCaml/Dune cache' | |
uses: actions/cache@v3 | |
with: | |
key: wasmstore-dune-${{ matrix.ocaml-compiler }}-${{ matrix.os }}-${{ hashFiles('src/**') }}-${{ hashFiles('dune-project') }} | |
path: _build | |
- name: 'Use OCaml ${{ matrix.ocaml-compiler }}' | |
uses: ocaml/setup-ocaml@v2 | |
with: | |
ocaml-compiler: '${{ matrix.ocaml-compiler }}' | |
- run: opam install . --deps-only -y | |
- name: 'Run OCaml tests' | |
run: opam exec -- dune runtest | |
- name: Generate executable | |
run: | | |
opam exec -- dune build | |
- name: Save wasmstore executable | |
uses: actions/upload-artifact@v3 | |
with: | |
name: wasmstore-${{ runner.platform }} | |
path: | | |
_build/install/default/bin/wasmstore | |
strategy: | |
fail-fast: true | |
matrix: | |
ocaml-compiler: | |
- 5.1 | |
os: | |
- macos-latest | |
- ubuntu-latest |