forked from AssemblyScript/assemblyscript
-
Notifications
You must be signed in to change notification settings - Fork 2
171 lines (171 loc) · 4.98 KB
/
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
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
name: Test
on:
push:
branches:
- main
pull_request:
jobs:
check:
name: "Check"
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: "Check that distribution files are unmodified"
if: github.event_name == 'pull_request'
run: |
if git --no-pager diff --name-only $(git rev-parse origin/${{ github.base_ref }})...${{ github.sha }} | grep -q "^dist/"; then
printf "\nThe pull request modifies distribution files, but it shouldn't.\n" &&
printf "Please see https://github.com/AssemblyScript/assemblyscript/blob/main/CONTRIBUTING.md\n" &&
exit 1;
else
printf "\nOK: Distributions files have not been modified.\n";
fi
test:
name: "Compiler (Linux, node ${{ matrix.node_version }})"
runs-on: ubuntu-latest
needs: check
strategy:
matrix:
node_version: ["current", "lts_latest"]
steps:
- uses: actions/[email protected]
- uses: dcodeIO/setup-node-nvm@master
with:
node-version: ${{ matrix.node_version }}
- name: Install dependencies
run: npm ci --no-audit
- name: Clean distribution files
run: npm run clean
- name: Check sources
run: npm run check
- name: Test sources
run: npm test
- name: Build distribution files
run: npm run build
- name: Test distribution
run: npm test
- name: Test browser build
run: node tests/browser-asc
test-windows:
name: "Compiler (Windows, node current)"
runs-on: windows-latest
needs: check
steps:
- uses: actions/[email protected]
- uses: dcodeIO/setup-node-nvm@master
with:
node-version: current
- name: Install dependencies
run: npm ci --no-audit
- name: Clean distribution files
run: npm run clean
- name: Test sources
run: npm test
- name: Build distribution files
run: npm run build
- name: Test distribution
run: npm test
- name: Test browser build
run: node tests/browser-asc
test-macos:
name: "Compiler (MacOS, node current)"
runs-on: macos-latest
needs: check
steps:
- uses: actions/[email protected]
- uses: dcodeIO/setup-node-nvm@master
with:
node-version: current
- name: Install dependencies
run: npm ci --no-audit
- name: Clean distribution files
run: npm run clean
- name: Test sources
run: npm test
- name: Build distribution files
run: npm run build
- name: Test distribution
run: npm test
- name: Test browser build
run: node tests/browser-asc
test-bootstrap:
name: "Compiler (Bootstrap)"
runs-on: ubuntu-latest
needs: check
steps:
- uses: actions/[email protected]
- uses: dcodeIO/setup-node-nvm@master
with:
node-version: current
- name: Install dependencies
run: npm ci --no-audit
- name: Clean distribution files
run: npm run clean
- name: Bootstrap the compiler
run: npm run bootstrap
- name: Run compiler tests (untouched-bootstrap)
run: npm run test:compiler -- --wasm out/assemblyscript.untouched-bootstrap.wasm
- name: Run compiler tests (optimized-bootstrap)
run: npm run test:compiler -- --wasm out/assemblyscript.optimized-bootstrap.wasm
test-features:
name: "Features"
runs-on: ubuntu-latest
needs: check
steps:
- uses: actions/[email protected]
- uses: dcodeIO/setup-node-nvm@master
with:
node-mirror: https://nodejs.org/download/v8-canary/
node-version: 17.0.0-v8-canary2021082701777958f9
- name: Install dependencies
run: npm ci --no-audit
- name: Clean distribution files
run: npm run clean
- name: Test experimental features
env:
ASC_FEATURES: mutable-globals,threads,reference-types,bigint-integration,gc
run: |
npm run test:compiler rt/flags features/js-bigint-integration features/reference-types features/threads std-wasi/process std-wasi/crypto
test-runtimes:
name: "Runtimes"
runs-on: ubuntu-latest
needs: check
steps:
- uses: actions/[email protected]
- uses: dcodeIO/setup-node-nvm@master
with:
node-version: current
- name: Install dependencies
run: npm ci --no-audit
- name: Clean distribution files
run: npm run clean
- name: Test default allocator
run: |
cd tests/allocators/default
npm run build
cd ..
npm test default
- name: Test stub allocator
run: |
cd tests/allocators/stub
npm run build
cd ..
npm test stub
test-loader:
name: "Loader"
runs-on: ubuntu-latest
needs: check
steps:
- uses: actions/[email protected]
- uses: dcodeIO/setup-node-nvm@master
with:
node-version: current
- name: Install dependencies
run: npm ci --no-audit
- name: Clean distribution files
run: npm run clean
- name: Test the loader
run: |
cd lib/loader
npm run asbuild
npm run test