-
-
Notifications
You must be signed in to change notification settings - Fork 52
80 lines (66 loc) · 2.02 KB
/
opam-build.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
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
name: Opam Pipeline
on:
pull_request:
push:
branches:
- main
schedule:
# Prime the caches every Monday
- cron: 0 1 * * MON
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build and test
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest
# - windows-latest # for some reason windows build is not picking dune 3.5
ocaml-compiler:
- ocaml-variants.5.1.0+trunk
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: 'recursive'
path: melange
- name: Use Node
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install Homebrew dependencies
if: ${{ matrix.os == 'macos-latest' }}
run: |
env HOMEBREW_NO_AUTO_UPDATE=1 brew install tree
- name: Use OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
- name: Install dependencies
working-directory: melange
run: |
opam update
make opam-install-test
- name: Clone melange-opam-template
run: |
git clone https://github.com/melange-re/melange-opam-template.git
cd melange-opam-template && git checkout anmonteiro/melange-ppx
- name: Install all deps
working-directory: melange-opam-template
run: |
opam pin add reason-react -y git+https://github.com/reasonml/reason-react.git#anmonteiro/mel-attrs
npm install
- name: Build basic template
working-directory: melange-opam-template
run: |
opam exec -- dune build @react @node --display=short
npm run bundle
- name: Run resulting .js files
working-directory: melange-opam-template
run: |
node ./_build/default/src/node/src/Hello.js