forked from AssemblyScript/assemblyscript
-
Notifications
You must be signed in to change notification settings - Fork 0
125 lines (125 loc) · 4.08 KB
/
ci.yml
File metadata and controls
125 lines (125 loc) · 4.08 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
name: CI
on:
push:
branches:
- master
pull_request:
jobs:
check:
name: "Check preconditions"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1.0.0
- name: "Check that author is present in the NOTICE file"
run: |
AUTHOR=$(git log -1 --format="%aE")
if [ -z "$AUTHOR" ]; then
printf "\Cannot perform NOTICE check: Commit does not include an email address.\n" &&
exit 1;
elif ! grep -q "$AUTHOR" NOTICE || false; then
printf "\nAuthor '$AUTHOR' does not appear to be listed in the NOTICE file, yet.\n" &&
printf "Please see https://github.com/AssemblyScript/assemblyscript/blob/master/CONTRIBUTING.md\n" &&
exit 1;
else
printf "\nOK: Author is present in the NOTICE file.\n";
fi
- name: "If a PR, 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/master/CONTRIBUTING.md\n" &&
exit 1;
else
printf "\nOK: Distributions files have not been modified.\n";
fi
test:
name: "Test compiler on node: ${{ matrix.node_version }}"
runs-on: ubuntu-latest
needs: check
strategy:
matrix:
node_version: ["lts/*", "node"]
steps:
- uses: actions/checkout@v1.0.0
- uses: dcodeIO/setup-node-nvm@v1.0.0
with:
node-version: ${{ matrix.node_version }}
- 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
test-windows:
name: "Test compiler on Windows with node: node"
runs-on: windows-latest
needs: check
steps:
- uses: actions/checkout@v1.0.0
- name: Install node via nvm-windows
run: |
Invoke-WebRequest -Uri https://github.com/coreybutler/nvm-windows/releases/download/1.1.7/nvm-noinstall.zip -OutFile nvm.zip
Expand-Archive nvm.zip -DestinationPath nvm
nvm/nvm install node
nvm/nvm use node
npm -g install npm@latest
- 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
test-canary:
name: "Test features on node: v8-canary"
runs-on: ubuntu-latest
needs: check
steps:
- uses: actions/checkout@v1.0.0
- uses: dcodeIO/setup-node-nvm@v1.0.0
with:
node-mirror: https://nodejs.org/download/v8-canary/
# FIXME: newer node-v8 builds are currently broken
node-version: "14.0.0-v8-canary201911242015a12d82"
- 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
run: |
npm run test:compiler rt/flags features/js-bigint-integration features/reference-types features/threads
test-runtime:
name: "Test runtimes on node: node"
runs-on: ubuntu-latest
needs: check
steps:
- uses: actions/checkout@v1.0.0
- uses: dcodeIO/setup-node-nvm@v1.0.0
with:
node-version: node
- name: Install dependencies
run: npm ci --no-audit
- name: Clean distribution files
run: npm run clean
- name: Test full runtime
run: |
cd tests/allocators/rt-full
npm run build
cd ..
npm test rt-full
- name: Test stub runtime
run: |
cd tests/allocators/rt-stub
npm run build
cd ..
npm test rt-stub