-
Notifications
You must be signed in to change notification settings - Fork 43
54 lines (43 loc) 路 1.42 KB
/
Copy pathworkflow.yml
File metadata and controls
54 lines (43 loc) 路 1.42 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
name: Build
on:
pull_request:
push:
jobs:
build:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
ocaml-compiler:
- 5.2.x
runs-on: ${{ matrix.os }}
steps:
- name: Install system dependencies (Ubuntu)
if: runner.os == 'Linux'
run: sudo apt-get update
- name: Checkout code
uses: actions/checkout@v4
- name: Use OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
- name: Install dependencies (locked)
run: opam install . --locked --deps-only --with-test
- name: Build
run: opam exec -- dune build --profile release
- name: Run tests
run: opam exec -- dune runtest --force --verbose
# Build and deploy release build that uses js-of-ocaml instead of wasm-of-ocaml
- name: Build js_of_ocaml version
run: |
cp bin/web/dune-for-js bin/web/dune
opam exec -- dune build --profile release --build-dir _build-js
cp -r _build-js/default/bin/web _build/default/bin/web/js
- name: Deploy website
uses: peaceiris/actions-gh-pages@v4
if: ${{ github.ref == 'refs/heads/main' && matrix.os == 'ubuntu-latest' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: _build/default/bin/web