-
Notifications
You must be signed in to change notification settings - Fork 5
194 lines (184 loc) · 9.41 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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
name: Run tests
on:
workflow_dispatch:
push:
jobs:
test-node-ver:
strategy:
fail-fast: false
matrix:
include:
# npx doesn't work on these older versions
#- version: '0.10.48'
# gyp_ver: '3.8.0'
# flags: ''
# python2: true
#- version: '4.9.1'
# gyp_ver: '4.0.0'
# flags: ''
# python2: true
- version: '8.17.0'
gyp_ver: '6.1.0'
flags: '--trace-warnings'
python2: true
- version: '12.22.12'
gyp_ver: '8.4.1'
flags: '--trace-warnings'
python2: false
- version: '20.11.0'
gyp_ver: '8.4.1'
flags: '--trace-warnings' #--pending-deprecation --throw-deprecation
python2: false
name: Test on node ${{ matrix.version }}
runs-on: ubuntu-latest
steps:
- uses: MatteoH2O1999/setup-python@v3
with:
python-version: '2.7'
if: ${{ matrix.python2 }}
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.version }}
- uses: actions/checkout@v3
- run: npx node-gyp@${{ matrix.gyp_ver }} rebuild --target=v${{ matrix.version }}
- uses: ./.github/actions/run_tests
with:
node: node ${{ matrix.flags }}
test-msvc-x86:
strategy:
fail-fast: false
matrix:
win_ver: [2019, 2022] # correlates with MSVC version
arch: [x86, x64]
name: Test on Windows ${{ matrix.win_ver }}, MSVC ${{ matrix.arch }}
runs-on: windows-${{ matrix.win_ver }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
architecture: ${{ matrix.arch }}
node-version: '20.11.0'
# TODO: consider SDE
- run: npx node-gyp rebuild --arch=${{ matrix.arch }} --target=v20.11.0
if: ${{ matrix.arch != 'x86' }}
- run: npx node-gyp rebuild --arch=ia32 --target=v20.11.0
if: ${{ matrix.arch == 'x86' }}
- uses: ./.github/actions/run_tests
#MSVC ARM?
test-gcc:
strategy:
fail-fast: false
matrix:
node_ver: ['12.22.12']
cc_ver: ['9','12']
t:
# qemu x86 doesn't support AVX, so we use Intel SDE instead
# NodeJS doesn't provide x86 Linux binaries
#- {arch: 'i386', nodearch: 'x86', gyparch: 'ia32', target: 'i686-linux-gnu', libc: 'i386', emu: '$SDE_PATH/sde -icx --'}
- {arch: 'amd64', nodearch: 'x64', gyparch: 'x64', target: 'x86-64-linux-gnu', libc: 'amd64', emu: '$SDE_PATH/sde64 -icx --'}
- {arch: 'aarch64', nodearch: 'arm64', gyparch: 'arm64', target: 'aarch64-linux-gnu', libc: 'arm64', emu: 'qemu-aarch64-static -L /usr/aarch64-linux-gnu -cpu max,sve-max-vq=4'}
- {arch: 'arm', nodearch: 'armv7l', gyparch: 'arm', target: 'arm-linux-gnueabihf', libc: 'armhf', emu: 'qemu-arm-static -L /usr/arm-linux-gnueabihf -cpu max'}
# RVV unavailable in Ubuntu 22.04's qemu
# TODO: consider using newer qemu
#- {arch: 'riscv64', nodearch: 'riscv64', gyparch: 'riscv64', target: 'riscv64-linux-gnu', libc: 'riscv64', emu: 'qemu-riscv64-static -L /usr/riscv64-linux-gnu -cpu rv64,v=true,vlen=512,elen=64,vext_spec=v1.0,zba=true,zbb=true,zbc=true'}
name: Test on GCC ${{ matrix.cc_ver }} ${{ matrix.t.arch }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- run: sudo apt update
- uses: petarpetrovt/[email protected]
if: ${{ matrix.t.arch == 'amd64' || matrix.t.arch == 'i386' }}
- run: sudo apt install -y qemu-user-static
if: ${{ matrix.t.arch != 'amd64' && matrix.t.arch != 'i386' }}
- run: |
sudo apt install -y g++-${{ matrix.cc_ver }}-${{ matrix.t.target }}
echo "CC=${{ matrix.t.target }}-gcc-${{ matrix.cc_ver }}" >> $GITHUB_ENV
echo "CXX=${{ matrix.t.target }}-g++-${{ matrix.cc_ver }}" >> $GITHUB_ENV
if: ${{ matrix.t.arch != 'amd64' }}
- run: |
sudo apt install -y g++-${{ matrix.cc_ver }}
echo "CC=gcc-${{ matrix.cc_ver }}" >> $GITHUB_ENV
echo "CXX=g++-${{ matrix.cc_ver }}" >> $GITHUB_ENV
if: ${{ matrix.t.arch == 'amd64' }}
- run: |
wget https://nodejs.org/download/release/v${{ matrix.node_ver }}/node-v${{ matrix.node_ver }}-linux-${{ matrix.t.nodearch }}.tar.xz
tar -Jxf node-v${{ matrix.node_ver }}-linux-${{ matrix.t.nodearch }}.tar.xz
mv node-v${{ matrix.node_ver }}-linux-${{ matrix.t.nodearch }} n
- run: npx [email protected] rebuild --arch=${{ matrix.t.gyparch }} --target=v${{ matrix.node_ver }} --openssl_fips='' --enable_native_tuning=0
- uses: ./.github/actions/run_tests
with:
node: ${{ matrix.t.emu }} n/bin/node
# test other ISA levels for x86
# TODO: test native tunings
- run: |
$SDE_PATH/sde -p4p -- n/bin/node test/testenc
$SDE_PATH/sde -mrm -- n/bin/node test/testenc
$SDE_PATH/sde -snb -- n/bin/node test/testenc
$SDE_PATH/sde -hsw -- n/bin/node test/testenc
$SDE_PATH/sde -p4p -- n/bin/node test/testdec
$SDE_PATH/sde -mrm -- n/bin/node test/testdec
$SDE_PATH/sde -snb -- n/bin/node test/testdec
$SDE_PATH/sde -hsw -- n/bin/node test/testdec
$SDE_PATH/sde -p4p -- n/bin/node test/testcrc
$SDE_PATH/sde -wsm -- n/bin/node test/testcrc
if: ${{ matrix.t.arch == 'amd64' || matrix.t.arch == 'i386' }}
test-clang:
strategy:
fail-fast: false
matrix:
node_ver: ['12.22.12']
cc_ver: ['11','15']
t:
#- {arch: 'i386', nodearch: 'x86', gyparch: 'ia32', target: 'i686-linux-gnu', cl_target: 'i386-linux-gnu', libc: 'i386', emu: '$SDE_PATH/sde -icx --'}
- {arch: 'amd64', nodearch: 'x64', gyparch: 'x64', target: 'x86-64-linux-gnu', cl_target: 'x86_64-linux-gnu', libc: 'amd64', emu: '$SDE_PATH/sde64 -icx --'}
- {arch: 'aarch64', nodearch: 'arm64', gyparch: 'arm64', target: 'aarch64-linux-gnu', cl_target: 'aarch64-linux-gnu', libc: 'arm64', emu: 'qemu-aarch64-static -L /usr/aarch64-linux-gnu -cpu max,sve-max-vq=4'}
- {arch: 'arm', nodearch: 'armv7l', gyparch: 'arm', target: 'arm-linux-gnueabihf', cl_target: 'armv7a-linux-gnueabihf', libc: 'armhf', emu: 'qemu-arm-static -L /usr/arm-linux-gnueabihf -cpu max'}
# RVV unavailable in Ubuntu 22.04's qemu
# TODO: consider using newer qemu
#- {arch: 'riscv64', nodearch: 'riscv64', gyparch: 'riscv64', target: 'riscv64-linux-gnu', cl_target: 'riscv64-linux-gnu', libc: 'riscv64', emu: 'qemu-riscv64-static -L /usr/riscv64-linux-gnu -cpu rv64,v=true,vlen=512,elen=64,vext_spec=v1.0,zba=true,zbb=true,zbc=true'}
name: Test Ubuntu Clang ${{ matrix.cc_ver }} ${{ matrix.t.arch }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- run: sudo apt update && sudo apt install -y clang-${{ matrix.cc_ver }}
- uses: petarpetrovt/[email protected]
if: ${{ matrix.t.arch == 'amd64' || matrix.t.arch == 'i386' }}
- run: sudo apt install -y qemu-user-static
if: ${{ matrix.t.arch != 'amd64' && matrix.t.arch != 'i386' }}
- run: sudo apt install -y binutils-${{ matrix.t.target }} libgcc-12-dev-${{ matrix.t.libc }}-cross libstdc++-12-dev-${{ matrix.t.libc }}-cross
if: ${{ matrix.t.arch != 'amd64' }}
- run: |
echo "CC=clang-${{ matrix.cc_ver }}" >> $GITHUB_ENV
echo "CXX=clang++-${{ matrix.cc_ver }}" >> $GITHUB_ENV
CFLAGS="--target=${{ matrix.t.cl_target }} -I/usr/${{ matrix.t.target }}/include -I`ls -d /usr/${{ matrix.t.target }}/include/c++/*|head -n1`/${{ matrix.t.target }}"
echo "CFLAGS=$CFLAGS" >> $GITHUB_ENV
echo "CXXFLAGS=$CFLAGS" >> $GITHUB_ENV
if [ '${{ matrix.t.arch }}' != 'amd64' ]; then
echo "LDFLAGS=-fuse-ld=/usr/bin/${{ matrix.t.target }}-ld -L/usr/lib/llvm-${{ matrix.cc_ver }}/lib/clang/ --target=${{ matrix.t.cl_target }}" >> $GITHUB_ENV
sed -i 's/"target_defaults": [{]/"target_defaults": { "libraries!":["-lnode"],/' binding.gyp
fi
- run: |
wget https://nodejs.org/download/release/v${{ matrix.node_ver }}/node-v${{ matrix.node_ver }}-linux-${{ matrix.t.nodearch }}.tar.xz
tar -Jxf node-v${{ matrix.node_ver }}-linux-${{ matrix.t.nodearch }}.tar.xz
mv node-v${{ matrix.node_ver }}-linux-${{ matrix.t.nodearch }} n
- run: npx [email protected] rebuild --arch=${{ matrix.t.gyparch }} --target=v${{ matrix.node_ver }} --openssl_fips='' --enable_native_tuning=0
- uses: ./.github/actions/run_tests
with:
node: ${{ matrix.t.emu }} n/bin/node
# test other ISA levels for x86
- run: |
$SDE_PATH/sde -p4p -- n/bin/node test/testenc
$SDE_PATH/sde -mrm -- n/bin/node test/testenc
$SDE_PATH/sde -snb -- n/bin/node test/testenc
$SDE_PATH/sde -hsw -- n/bin/node test/testenc
$SDE_PATH/sde -p4p -- n/bin/node test/testdec
$SDE_PATH/sde -mrm -- n/bin/node test/testdec
$SDE_PATH/sde -snb -- n/bin/node test/testdec
$SDE_PATH/sde -hsw -- n/bin/node test/testdec
$SDE_PATH/sde -p4p -- n/bin/node test/testcrc
$SDE_PATH/sde -wsm -- n/bin/node test/testcrc
if: ${{ matrix.t.arch == 'amd64' || matrix.t.arch == 'i386' }}
# TODO: MSYS tests?
# TODO: test w/ Apple Clang
# TODO: test varying 'native' configs, disabled 256b config
# TODO: big endian config