-
Notifications
You must be signed in to change notification settings - Fork 7
187 lines (160 loc) · 4.48 KB
/
ci.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
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
################################
##
## BUILD
##
################################
Build:
name: Build
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: 'Checkout'
uses: actions/checkout@v4
with:
submodules: recursive
- name: 'Setup Emscripten'
uses: mymindstorm/setup-emsdk@v11
with:
version: 3.1.47
- name: 'Setup Python'
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: 'Install Meson & Ninja'
uses: BSFishy/pip-action@v1
with:
packages: |
meson
ninja
- name: Write em.txt
uses: "DamianReeves/write-file-action@master"
with:
path: libultrahdr-wasm/em.txt
write-mode: overwrite
contents: |
[binaries]
c = 'emcc'
cpp = 'em++'
ar = 'emar'
nm = 'emnm'
[host_machine]
system = 'emscripten'
cpu_family = 'wasm32'
cpu = 'wasm32'
endian = 'little'
- name: 'Build libultrahdr WASM'
run: |
cd libultrahdr-wasm
meson setup build --cross-file=em.txt
meson compile -C build
- name: 'Setup Nodejs'
uses: actions/setup-node@v3
with:
node-version: 20
- name: 'Install dependencies'
run: npm ci
- name: 'Build'
run: npm run build
- name: 'Upload Build artifacts'
if: always()
uses: actions/upload-artifact@v3
with:
name: build-artifact
if-no-files-found: error
path: |
libultrahdr-wasm/build/*.ts
libultrahdr-wasm/build/*.js
libultrahdr-wasm/build/*.map
libultrahdr-wasm/build/*.wasm
dist/
################################
##
## CHECKS
##
################################
Check:
name: Check
needs: Build
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v4
with:
submodules: recursive
- name: 'Download build artifacts'
uses: actions/download-artifact@v3
with:
name: build-artifact
- name: 'Setup Nodejs'
uses: actions/setup-node@v3
with:
node-version: 20
- name: 'Install dependencies'
run: npm ci
- name: 'Produce Reports & Logs'
if: always()
run: npm run ci:check
- name: 'Upload Check artifacts'
if: always()
uses: actions/upload-artifact@v3
with:
name: check-artifact
if-no-files-found: error
path: |
reports/
################################
##
## TEST
##
################################
Test:
name: Test
needs: Build
runs-on: ubuntu-latest
# container:
# image: mcr.microsoft.com/playwright:v1.40.0-jammy
steps:
# - name: 'Initialize Git LFS'
# run: curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
# - name: 'Install Git LFS'
# run: apt-get install -y git-lfs
- name: 'Checkout'
uses: actions/checkout@v4
with:
submodules: recursive
- name: 'Download build artifacts'
uses: actions/download-artifact@v3
with:
name: build-artifact
- name: 'Setup Nodejs'
uses: actions/setup-node@v3
with:
node-version: 20
- name: 'Install dependencies'
run: npm ci
- name: 'Install playwright Browsers'
run: npx playwright install --with-deps
- name: 'Run Playwright Tests'
run: npm test
# env:
# HOME: /root
- name: 'Upload Test artifacts'
if: always()
uses: actions/upload-artifact@v3
with:
name: test-artifact
if-no-files-found: error
path: |
.nyc_output/
test-results/
coverage/
playwright-report/
tests/__snapshots__/