Skip to content

Commit cae822d

Browse files
committed
Adjust CI to cater to recent build changes
See #137 First part. Will update with the recent setup-ocaml and other changes later
1 parent 972b5b8 commit cae822d

File tree

1 file changed

+44
-31
lines changed

1 file changed

+44
-31
lines changed

.github/workflows/ci.yml

Lines changed: 44 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,57 @@
11
name: CI
22

33
on:
4-
pull_request:
54
push:
6-
schedule:
7-
# Prime the caches every Monday
8-
- cron: 0 1 * * MON
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
98

109
jobs:
1110
test:
1211
strategy:
1312
fail-fast: false
1413
matrix:
15-
os:
16-
- macos-latest
17-
- ubuntu-latest
18-
- windows-latest
19-
ocaml-compiler:
20-
- 4.06.x
21-
14+
os: [macos-latest, ubuntu-latest, windows-latest]
2215

23-
24-
runs-on: ${{ matrix.os }}
16+
runs-on: ${{matrix.os}}
2517

2618
steps:
27-
- name: Checkout code
28-
uses: actions/checkout@v2
29-
30-
- name: Use Node.js 14.x
31-
uses: actions/setup-node@v2
32-
with:
33-
node-version: 14.x
34-
35-
- run: npm ci
36-
37-
- name: Use OCaml ${{ matrix.ocaml-compiler }}
38-
uses: avsm/setup-ocaml@v2
39-
with:
40-
ocaml-compiler: ${{ matrix.ocaml-compiler }}
41-
42-
- run: opam install . --deps-only
43-
44-
- run: opam exec -- dune build
19+
- uses: actions/checkout@v2.3.4
20+
21+
- name: Cache OCaml's opam
22+
uses: actions/cache@v2.1.5
23+
with:
24+
path: ~/.opam
25+
key: ${{matrix.os}}-latest-ocaml-4.06.1
26+
27+
- name: Use OCaml
28+
uses: avsm/setup-ocaml@v1.1.10
29+
with:
30+
ocaml-version: 4.06.1
31+
32+
- name: Use Node.js
33+
uses: actions/setup-node@v2.1.5
34+
with:
35+
node-version: 14.4.0
36+
37+
- run: npm ci
38+
39+
# These 2 runs (or just the second?) are for when you have opam dependencies. We don't.
40+
# Don't add deps. But if you ever do, un-comment these
41+
# - run: opam pin add rescript-editor-support.dev . --no-action
42+
# - run: opam install . --deps-only --with-doc --with-test
43+
44+
- run: eval $(opam env) && make
45+
if: matrix.os != 'windows-latest'
46+
- run: "& $env:CYGWIN_ROOT\\bin\\ocaml-env exec -- make"
47+
if: matrix.os == 'windows-latest'
48+
49+
# Also avoids artifacts upload permission loss:
50+
# https://github.com/actions/upload-artifact/tree/ee69f02b3dfdecd58bb31b4d133da38ba6fe3700#permission-loss
51+
- name: Compress files
52+
run: tar -cvf rescript-editor-support.tar -C lib rescript-editor-support.exe
53+
54+
- uses: actions/upload-artifact@v2
55+
with:
56+
name: ${{matrix.os}}-rescript-editor-support.exe
57+
path: rescript-editor-support.tar

0 commit comments

Comments
 (0)