-
Notifications
You must be signed in to change notification settings - Fork 1
271 lines (265 loc) · 7.99 KB
/
docker.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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
name: Docker
run-name: Test docker image
on:
workflow_dispatch:
push:
branches: ["main"] # replace "main" with the default branch
pull_request:
branches: ["main"]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
name: 'Build image'
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-node@v4
- name: Setup docker (missing on MacOS)
if: runner.os == 'macos'
run: |
brew install docker
colima start
- name: Set up Docker
uses: docker/setup-buildx-action@v3
- name: Build server docker image
uses: docker/build-push-action@v6
with:
tags: lean4monaco:latest
outputs: type=docker,dest=/tmp/lean4monaco.tar
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: lean4monaco
path: /tmp/lean4monaco.tar
test:
needs: build
# # strategy:
# # fail-fast: false
# # matrix:
# # include:
# # - name: Linux
# # os: ubuntu-latest
# # - name: macOS
# # os: macos-latest
# # - name: Windows
# # os: windows-latest
# # name: ${{ matrix.name }}
# # runs-on: ${{ matrix.os }}
name: Test image
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v4
with:
submodules: true
# - uses: leanprover/lean-action@v1
# if: matrix.os != 'windows-latest'
# with:
# lake-package-directory: "demo/server/LeanProject"
# use-mathlib-cache: false
# auto-config: false
# build: true
# test: false
# lint: false
# - name: Install elan (Windows)
# if: matrix.os == 'windows-latest'
# run: |
# curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf > elan-init.sh
# bash elan-init.sh -y
# echo "$(realpath ~/.elan/bin)" >> $GITHUB_PATH
# shell: bash
# - name: Run lake build (Windows)
# if: matrix.os == 'windows-latest'
# run: |
# cd demo/server/LeanProject
# lake build
# shell: bash
- name: Install dependencies
run: npm install
# - name: Build
# run: npm run build
# - run: npm run setup_demo
- name: Download server image
uses: actions/download-artifact@v4
with:
name: lean4monaco
path: /tmp
- name: Load server image
run: docker load --input /tmp/lean4monaco.tar
- name: Start server
run: docker run -dit -p 5173:5173 -p 8080:8080 lean4monaco
- name: Run tests
uses: cypress-io/github-action@v6
with:
# browser: chrome
# start: npm start
wait-on: 'http://localhost:5173'
# test:
# strategy:
# fail-fast: false
# matrix:
# include:
# - name: Linux
# os: ubuntu-latest
# - name: macOS
# os: macos-latest
# - name: Windows
# os: windows-latest
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# with:
# submodules: true
# - name: build docker image
# run: docker build -t hhu-adam/lean4monaco .
# - name: start server
# run: docker run -dit -p 5173:5173 -p 8080:8080 hhu-adam/lean4monaco
# - name: Run tests
# uses: cypress-io/github-action@v6
# with:
# browser: chrome
# # start: npm start
# wait-on: 'http://localhost:5173'
# start-server:
# name: Start server
# runs-on: ubuntu-latest
# # outputs:
# # server-url: ${{ steps.server-output.outputs.server-url }}
# steps:
# - uses: actions/checkout@v4
# with:
# submodules: true
# - uses: actions/setup-node@v4
# - uses: leanprover/lean-action@v1
# with:
# lake-package-directory: "demo/server/LeanProject"
# use-mathlib-cache: false
# auto-config: false
# build: true
# test: false
# lint: false
# - name: Install dependencies
# run: npm install
# - name: Build and setup demo
# run: npm run setup_demo
# # - name: Build lean4monaco
# # run: npm run build
# # - name: Build demo server
# # run: |
# # cd demo
# # npm run build
# - name: Start server
# id: start-server
# run: |
# nohup npm start > nohup.out 2> nohup.err < /dev/null &
# echo "server is running..."
# # cd demo
# # echo "Starting server..."
# # npm run start
# # # nohup npm run start > nohup.out 2> nohup.err < /dev/null &
# # echo "server is running."
# test:
# strategy:
# fail-fast: false
# matrix:
# include:
# - name: Linux
# os: ubuntu-latest
# # - name: macOS
# # os: macos-latest
# - name: Windows
# os: windows-latest
# name: ${{ matrix.name }}
# runs-on: ${{ matrix.os }}
# needs: start-server
# steps:
# - uses: actions/checkout@v4
# with:
# submodules: true
# - uses: actions/setup-node@v4
# - name: Install dependencies
# run: npm install
# # - name: Wait for server
# # run: |
# # echo "Pinging the server to check if it's up..."
# # for i in {1..30}; do
# # curl -sSf http://localhost:5173 && break
# # echo "Waiting for server..."
# # sleep 5
# # done
# # - name: Run Cypress tests
# # run: |
# # # wait-on http://localhost:5173
# # cypress run
# # # # Install npm dependencies, cache them correctly
# # and run all Cypress tests
# - name: Run tests
# uses: cypress-io/github-action@v6
# with:
# browser: chrome
# # start: npm start
# # wait-on: 'http://localhost:5173'
# name: Test
# run-name: Test editor end-to-end
# on:
# workflow_dispatch:
# push:
# branches: ["main"] # replace "main" with the default branch
# pull_request:
# branches: ["main"]
# concurrency:
# group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
# cancel-in-progress: true
# jobs:
# test:
# strategy:
# fail-fast: false
# matrix:
# include:
# - name: Linux
# os: ubuntu-latest
# - name: macOS
# os: macos-latest
# - name: Windows
# os: windows-latest
# name: ${{ matrix.name }}
# runs-on: ${{ matrix.os }}
# steps:
# - uses: actions/checkout@v4
# with:
# submodules: true
# - uses: leanprover/lean-action@v1
# if: matrix.os != 'windows-latest'
# with:
# lake-package-directory: "demo/server/LeanProject"
# use-mathlib-cache: false
# build: true
# test: false
# lint: false
# - name: Install elan (Windows)
# if: matrix.os == 'windows-latest'
# run: |
# curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf > elan-init.sh
# bash elan-init.sh -y
# echo "$(realpath ~/.elan/bin)" >> $GITHUB_PATH
# shell: bash
# - name: Run lake build (Windows)
# if: matrix.os == 'windows-latest'
# run: |
# cd demo/server/LeanProject
# lake build
# shell: bash
# - uses: actions/setup-node@v4
# # Install npm dependencies, cache them correctly
# # and run all Cypress tests
# - name: Run tests
# uses: cypress-io/github-action@v6
# with:
# start: npm start
# wait-on: 'http://localhost:5173'
# - run: npm audit
# if: matrix.os == 'ubuntu-latest'
# continue-on-error: true