-
Notifications
You must be signed in to change notification settings - Fork 32
230 lines (197 loc) · 6.05 KB
/
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
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
name: Github CI
on:
push:
branches:
- main
- v8.20
- v8.19
- v8.18
- v8.17
- v8.16
- v8.15
pull_request:
branches:
- main
- v8.20
- v8.19
- v8.18
- v8.17
- v8.16
- v8.15
# Cancels previous runs of the same workflow
concurrency:
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
cancel-in-progress: true
jobs:
build:
strategy:
matrix:
include:
- os: ubuntu-latest
ocaml: 4.14.x
- os: ubuntu-latest
ocaml: 4.13.x
- os: ubuntu-latest
ocaml: 4.12.x
- os: ubuntu-latest
ocaml: 5.0.x
- os: ubuntu-latest
ocaml: 5.1.x
- os: ubuntu-latest
ocaml: 5.2.x
- os: macos-latest
ocaml: 4.14.x
- name: Windows Latest
ocaml: 4.14
os: windows-latest
opam-repositories: |
windows-5.0: https://github.com/dra27/opam-repository.git#windows-5.0
opam-repository-mingw: https://github.com/ocaml-opam/opam-repository-mingw.git#sunset
default: https://github.com/ocaml/opam-repository.git
fail-fast: false
runs-on: ${{ matrix.os }}
timeout-minutes: 45
steps:
- name: 🔭 Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: 🐫 Setup OCaml
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: ${{ matrix.ocaml }}
dune-cache: true
opam-repositories: ${{ matrix.opam-repositories }}
- name: 🐫🐪🐫 Get dependencies
run: opam exec -- make opam-deps
- name: 🐛 Special Windows Config [only on Win CI]
if: matrix.os == 'windows-latest'
run: opam exec -- make winconfig
- name: 🧱 Build coq-lsp
run: opam exec -- make build
- name: 🐛 Test coq-lsp
run: opam exec -- make test
- name: 🐛 Test fcc
run: opam exec -- make test-compiler
build-js:
name: Web Worker Build
strategy:
fail-fast: false
runs-on: ubuntu-latest
steps:
# OPAM figures out everything but the libgmp-dev:i386
# dependency, maybe worth fixing this upstream in the opam
# repository
- name: Install apt dependencies
run: |
sudo apt-get install aptitude
sudo dpkg --add-architecture i386
sudo aptitude -o Acquire::Retries=30 update -q
sudo aptitude -o Acquire::Retries=30 install gcc-multilib g++-multilib pkg-config libgmp-dev libgmp-dev:i386 -y
- name: 🔭 Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: 🐫 Setup OCaml
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: "ocaml-variants.4.14.2+options,ocaml-option-32bit"
dune-cache: true
- name: 🐫🐪🐫 Get dependencies
run: |
opam exec -- make opam-deps
opam pin add js_of_ocaml-compiler --dev -y
opam pin add js_of_ocaml --dev -y
opam install zarith_stubs_js js_of_ocaml-ppx -y
- name: 💉💉💉 Patch Coq
run: make patch-for-js
- name: 🦏🧱🦏 Build coq-lsp JS version 🦏🦏🦏
run: |
opam exec -- make controller-js/coq-fs-core.js
opam exec -- make js
- name: 🚀 Setup node
uses: actions/setup-node@v4
with:
node-version: 22
- name: 🦏🧱🦏 Build coq-lsp VSCode extension 🦏🦏🦏
run: opam exec -- make extension
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: coq-lsp_worker and front-end
path: |
editor/code/package.json
editor/code/README.md
editor/code/CHANGELOG.md
editor/code/syntaxes
editor/code/out/
editor/code/coq.configuration.json
compression-level: 9
build-opam:
name: Opam dev install
strategy:
fail-fast: false
runs-on: ubuntu-latest
steps:
- name: 🔭 Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: 🐫 Setup OCaml
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: 4.14.x
dune-cache: true
- name: Install Coq and SerAPI into OPAM switch
run: |
opam install lwt logs # Also build pet-server
opam install memprof-limits # We need to do this to avoid coq-lsp rebuilding Coq below due to deptops
opam install vendor/coq/{coq-core,coq-stdlib,coqide-server,coq}.opam
- name: Install `coq-lsp` into OPAM switch
run: opam install .
- name: Test `coq-lsp` in installed switch
run: opam exec -- fcc examples/Demo.v
- name: Test `pet-server` is built
run: opam exec -- which pet-server
build-nix:
name: Nix
strategy:
matrix:
os: [ubuntu-latest, macOS-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: 🔭 Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: ❄️ Setup Nix
uses: cachix/install-nix-action@v27
- name: 🧱 Build coq-lsp
run: nix build '.?submodules=1#'
client-compile:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./editor/code
steps:
- name: 🔭 Checkout code
uses: actions/checkout@v4
- name: 🚀 Setup node
uses: actions/setup-node@v4
with:
node-version: 22
- run: npm ci
- run: npx --yes @vscode/vsce ls
nix-flake-check:
name: Nix Flake Check
runs-on: ubuntu-latest
steps:
- name: 🔭 Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: ❄️ Setup Nix
uses: cachix/install-nix-action@v18
- name: 📐 Run flake check
run: nix flake check