-
Notifications
You must be signed in to change notification settings - Fork 123
126 lines (108 loc) · 3.52 KB
/
build-and-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
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
name: Build and Test
on:
pull_request:
push:
branches:
-master
schedule:
# Prime the caches every Monday
- cron: 0 1 * * MON
jobs:
build-and-test:
name: Build and Test
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest
ocaml-compiler:
- 4.14.x
- 5.0.x
- ocaml-variants.5.1.0+trunk
exclude:
- os: windows-latest
ocaml-compiler: 5.0.x
- os: windows-latest
ocaml-compiler: ocaml-variants.5.1.0+trunk
- os: macos-latest
ocaml-compiler: 5.0.x
- os: macos-latest
ocaml-compiler: ocaml-variants.5.1.0+trunk
runs-on: ${{ matrix.os }}
steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: true
- name: Use latest LTS Node.js release
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Install npm packages
run: yarn --frozen-lockfile
working-directory: ocaml-lsp-server/test/e2e
- name: Use OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v2
if: matrix.os != 'windows-latest'
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
- name: Use OCaml ${{ matrix.ocaml-compiler }} (Win)
uses: ocaml/setup-ocaml@v2
if: matrix.os == 'windows-latest'
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
opam-repositories: |
opam-repository-mingw: https://github.com/ocaml-opam/opam-repository-mingw.git#sunset
default: https://github.com/ocaml/opam-repository.git
- name: Build and install opam packages
run: opam install .
# the makefile explains why we don't use --with-test
# ppx expect is not yet compatible with 5.1 and test output vary from one
# compiler to another. We only test on 4.14.
- name: Install test dependencies
if: matrix.ocaml-compiler == '4.14.x'
run: opam exec -- make install-test-deps
- name: Run build @all
if: matrix.ocaml-compiler == '4.14.x'
run: opam exec -- make all
- name: Run the unit tests
if: matrix.ocaml-compiler == '4.14.x'
run: opam exec -- make test-ocaml
- name: Run the template integration tests
if: matrix.ocaml-compiler == '4.14.x'
run: opam exec -- make test-e2e
coverage:
name: Coverage
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ocaml-compiler:
- 4.14.x
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Use OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
opam-depext: false
- name: Set git user
run: |
git config --global user.name github-actions[bot]
git config --global user.email github-actions[bot]@users.noreply.github.com
- name: Install deps on Unix
run: |
opam install . --deps-only
opam exec -- make coverage-deps install-test-deps
- run: opam exec -- make test-coverage
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PULL_REQUEST_NUMBER: ${{ github.event.number }}