forked from petersalomonsen/wasm-git
-
Notifications
You must be signed in to change notification settings - Fork 0
194 lines (194 loc) · 7.65 KB
/
Copy pathmain.yml
File metadata and controls
194 lines (194 loc) · 7.65 KB
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
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
detectonly:
name: Detect use of .only
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Detect use of .only
run: |
grep -rq --include '*.spec.js' \.only\( . && echo 'You have .only() in your tests!' && exit 1
exit 0
default:
name: "Default"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Default
run: |
npm install
npx playwright install-deps
npx playwright install
sh setup.sh
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install 4.0.23
./emsdk activate 4.0.23
cd ..
source ./emsdk/emsdk_env.sh
cd emscriptenbuild
./build.sh Release
cd ..
set -e
npm run test
npm run test-browser
asyncify:
name: Asyncify
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Default
run: |
npm install
npx playwright install-deps
npx playwright install
sh setup.sh
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install 4.0.23
./emsdk activate 4.0.23
cd ..
source ./emsdk/emsdk_env.sh
cd emscriptenbuild
./build.sh Release-async
cd ..
set -e
npm run test-browser-async
opfs:
name: OPFS
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: OPFS Build and Test
run: |
npm install
npx playwright install-deps
npx playwright install
sh setup.sh
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install 4.0.23
./emsdk activate 4.0.23
cd ..
source ./emsdk/emsdk_env.sh
cd emscriptenbuild
./build.sh Release-opfs
cd ..
ln -s ../emscriptenbuild/libgit2/examples/lg2_opfs.js test-browser-opfs/lg2_opfs.js
ln -s ../emscriptenbuild/libgit2/examples/lg2_opfs.wasm test-browser-opfs/lg2_opfs.wasm
ln -s ../../emscriptenbuild/libgit2/examples/lg2_opfs.js examples/opfs/lg2_opfs.js
ln -s ../../emscriptenbuild/libgit2/examples/lg2_opfs.wasm examples/opfs/lg2_opfs.wasm
set -e
npm run test-browser-opfs
npm run test-opfs-example
opfs-sab-free:
name: OPFS (SAB-free ASYNCIFY + JSPI + loader)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build SAB-free OPFS variants and test
run: |
npm install
npx playwright install-deps
# The loader matrix needs chromium, firefox and webkit. The playwright
# install intermittently hangs right after a download reaches 100%, so
# wrap it in a bounded timeout+retry that force-kills (-k) a stalled
# attempt and clears any lingering downloader before retrying.
for i in 1 2 3; do
timeout -k 15 180 npx playwright install && break
echo "playwright install attempt $i stalled or failed; retrying..."
pkill -f playwright || true
sleep 5
done
sh setup.sh
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install 4.0.23
./emsdk activate 4.0.23
cd ..
source ./emsdk/emsdk_env.sh
# Build all three OPFS variants, copying each output to the repo root.
# Clean the build tree between variants so changed link flags fully reconfigure.
cd emscriptenbuild
clean() { rm -rf CMakeCache.txt CMakeFiles libgit2 Makefile cmake_install.cmake; }
./build.sh Release-opfs && cp libgit2/examples/lg2_opfs.js libgit2/examples/lg2_opfs.wasm ../ && clean
./build.sh Release-opfs-async && cp libgit2/examples/lg2_opfs_async.js libgit2/examples/lg2_opfs_async.wasm ../ && clean
./build.sh Release-opfs-jspi && cp libgit2/examples/lg2_opfs_jspi.js libgit2/examples/lg2_opfs_jspi.wasm ../
cd ..
# Symlink the loader and all variant files into the non-isolated test dir
ln -s ../lg2_opfs_auto.js test-browser-opfs-noniso/lg2_opfs_auto.js
ln -s ../lg2_opfs.js test-browser-opfs-noniso/lg2_opfs.js
ln -s ../lg2_opfs.wasm test-browser-opfs-noniso/lg2_opfs.wasm
ln -s ../lg2_opfs_async.js test-browser-opfs-noniso/lg2_opfs_async.js
ln -s ../lg2_opfs_async.wasm test-browser-opfs-noniso/lg2_opfs_async.wasm
ln -s ../lg2_opfs_jspi.js test-browser-opfs-noniso/lg2_opfs_jspi.js
ln -s ../lg2_opfs_jspi.wasm test-browser-opfs-noniso/lg2_opfs_jspi.wasm
set -e
npm run test-opfs-detect
npm run test-browser-opfs-noniso
npm run test-opfs-loader
package:
name: "Package (tarball browser tests)"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Pack the npm tarball and run the browser tests against it
run: |
npm install
npx playwright install-deps
# bounded retry (same as the other jobs)
for i in 1 2 3; do
timeout -k 15 180 npx playwright install && break
echo "playwright install attempt $i stalled or failed; retrying..."
pkill -f playwright || true
sleep 5
done
sh setup.sh
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install 4.0.23
./emsdk activate 4.0.23
cd ..
source ./emsdk/emsdk_env.sh
# Build every variant (no clean: differently-named outputs coexist, the
# same way the publish workflow builds) so preparepublishnpm.sh can copy
# them all to the repo root.
cd emscriptenbuild
./build.sh Release
./build.sh Release-async
./build.sh Release-opfs
./build.sh Release-opfs-async
./build.sh Release-opfs-jspi
cd ..
set -e
# Produce the exact npm tarball, then run the browser suites against the
# EXTRACTED files — that is what consumers install, so this catches
# packaging mistakes (missing/renamed/corrupt files) that testing the
# raw build outputs would not.
./preparepublishnpm.sh
PACKAGEFILE=`npm pack | tail -n 1`
rm -rf package && tar -xzf "$PACKAGEFILE"
cp package/lg2*.js package/lg2*.wasm package/lg2_opfs_auto.js .
# Point every browser test dir at the packed files at the repo root.
ln -sf ../lg2.js test-browser/lg2.js
ln -sf ../lg2.wasm test-browser/lg2.wasm
ln -sf ../lg2_async.js test-browser-async/lg2_async.js
ln -sf ../lg2_async.wasm test-browser-async/lg2_async.wasm
ln -sf ../lg2_opfs.js test-browser-opfs/lg2_opfs.js
ln -sf ../lg2_opfs.wasm test-browser-opfs/lg2_opfs.wasm
ln -sf ../../lg2_opfs.js examples/opfs/lg2_opfs.js
ln -sf ../../lg2_opfs.wasm examples/opfs/lg2_opfs.wasm
for f in lg2_opfs_auto.js lg2_opfs.js lg2_opfs.wasm lg2_opfs_async.js lg2_opfs_async.wasm lg2_opfs_jspi.js lg2_opfs_jspi.wasm; do
ln -sf ../$f test-browser-opfs-noniso/$f
done
npm run test-browser
npm run test-browser-async
npm run test-browser-opfs
npm run test-opfs-example
npm run test-browser-opfs-noniso
npm run test-opfs-loader