-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (41 loc) · 1.36 KB
/
test.yml
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
on:
pull_request:
workflow_dispatch:
name: OCaml CI
jobs:
test:
name: OCaml
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
compiler: [ "5.1" ]
steps:
- name: Checkout sources
uses: actions/checkout@v3
- uses: ./.github/actions/libextism
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Setup OCaml env
uses: ocaml/setup-ocaml@v2
with:
dune-cache: true
ocaml-compiler: ${{ matrix.compiler }}
- run: opam exec -- ocamlc -version > .ocaml-version
- name: Cache OCaml
id: cache-ocaml
uses: actions/cache@v3
with:
path: _opam
key: ${{ runner.os }}-opam-${{ hashFiles('*.opam') }}-${{ hashFiles('dune-project') }}-${{ hashFiles('.ocaml-version') }}
- name: Build OCaml Host SDK
if: steps.cache-ocaml.outputs.cache-hit != 'true'
run: |
opam upgrade -y
opam install -y --deps-only --with-test --with-doc .
LD_LIBRARY_PATH=/usr/local/lib opam exec -- dune build
- name: Test OCaml Host SDK
run: |
opam upgrade -y
LD_LIBRARY_PATH=/usr/local/lib opam exec -- dune exec ./bin/main.exe wasm/code.wasm count_vowels -- --input "qwertyuiop"
LD_LIBRARY_PATH=/usr/local/lib opam exec -- dune runtest