-
Notifications
You must be signed in to change notification settings - Fork 8
130 lines (108 loc) · 3.78 KB
/
workflow.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: Main Workflow
on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
build:
strategy:
fail-fast: true
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
ocaml-compiler:
- 4.14.0
skip_test:
- false
include:
- os: ubuntu-latest
ocaml-compiler: 4.12.1
skip_test: true
- os: ubuntu-latest
ocaml-compiler: 4.11.2
skip_test: true
- os: ubuntu-latest
ocaml-compiler: 4.08.1
skip_test: true
- os: ubuntu-latest
ocaml-compiler: 4.07.1
skip_test: true
- os: ubuntu-latest
ocaml-compiler: 4.04.2
skip_test: true
- os: ubuntu-latest
ocaml-compiler: 4.03.0
skip_test: true
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Retrieve opam cache
uses: actions/cache@v2
id: cache-opam
with:
path: ~/.opam
key: v2-${{ runner.os }}-ocaml-canvas-${{ matrix.ocaml-compiler }}-${{ hashFiles('*.opam') }}
# restore-keys: |
# v2-${{ runner.os }}-opam-${{ matrix.ocaml-compiler }}-
- name: Use OCaml ${{ matrix.ocaml-compiler }}
uses: avsm/setup-ocaml@v2
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
opam-pin: false
opam-depext: false
- name: Set git user
run: |
git config --global user.name github-actions
git config --global user.email [email protected]
# define opam-repo = "git+https://" to add an extra opam repo
- run: opam pin add . -y --no-action
- run: opam depext -y conf-libwayland conf-wayland-protocols
if: matrix.os == 'ubuntu-latest'
# if: steps.cache-opam.outputs.cache-hit != 'true'
- run: opam depext -y ocaml-canvas
# if: steps.cache-opam.outputs.cache-hit != 'true'
- run: opam install -y conf-libwayland conf-wayland-protocols
if: matrix.os == 'ubuntu-latest'
# if: steps.cache-opam.outputs.cache-hit != 'true'
- run: opam install -y js_of_ocaml>=3.6
# if: steps.cache-opam.outputs.cache-hit != 'true'
- run: opam install -y ocaml-canvas --deps-only --with-test
# if: steps.cache-opam.outputs.cache-hit != 'true'
# - run: opam upgrade --fixup
# if: steps.cache-opam.outputs.cache-hit == 'true'
# - run: dos2unix scripts/*.sh
# if: matrix.os == 'windows-latest'
- run: make build
# - name: run test suite
# run: |
# ./scripts/before.sh test
# opam exec -- dune build @runtest
# ./scripts/after.sh test
# if: matrix.skip_test != 'true'
# - name: test source is well formatted
# run: make fmt
# continue-on-error: true
# if: matrix.ocaml-compiler == '4.14.0' && matrix.os == 'ubuntu-latest'
- name: build-doc
if: github.ref == 'refs/heads/master' && matrix.ocaml-compiler == '4.14.0' && matrix.os == 'ubuntu-latest'
run: |
sudo apt install -yqq python3-sphinx python3-sphinx-rtd-theme
opam install -y dune odoc
make doc
touch _build/docs/.nojekyll
touch _build/docs/sphinx/.nojekyll
touch _build/docs/doc/.nojekyll
- name: deploy-doc
uses: JamesIves/[email protected]
if: github.ref == 'refs/heads/master' && matrix.ocaml-compiler == '4.14.0' && matrix.os == 'ubuntu-latest'
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: _build/docs/
CLEAN: true