@@ -26,23 +26,48 @@ jobs:
26
26
- 20
27
27
- 22
28
28
fail-fast : false
29
- name : Testing Node ${{ matrix.node }} on ${{ matrix.os }}
29
+ name : Test Node ${{ matrix.node }} on ${{ matrix.os }}
30
30
runs-on : ${{ matrix.os }}
31
+ defaults :
32
+ run :
33
+ shell : bash
31
34
steps :
32
- - uses : actions/checkout@v4
35
+ - name : Checkout repository
36
+ uses : actions/checkout@v4
33
37
with :
34
38
submodules : true
35
39
fetch-depth : 0
36
- - uses : actions/setup-node@v4
40
+
41
+ - name : Setup Node
42
+ uses : actions/setup-node@v4
37
43
with :
38
44
node-version : ${{ matrix.node }}
39
45
40
- - run : npm install
41
- - run : npm run build_x64
42
- - run : npm run build_arm64
43
- - run : npm test
46
+ - name : Install dependencies
47
+ run : npm ci --legacy-peer-deps
48
+
49
+ - name : Set npm_config_target
50
+ run : echo "CONFIG_TARGET=${{ matrix.node == 22 && '22.12.0' || '20.9.0' }}" >> $GITHUB_ENV
51
+
52
+ - name : Build x64 binary
53
+ run : npm_config_target=${{ env.CONFIG_TARGET }} npm x -- prebuildify --napi --arch x64 -t 20.9.0
54
+
55
+ - name : Set up cross-compilation
56
+ if : runner.os == 'Linux'
57
+ run : |-
58
+ sudo apt-get update
59
+ sudo apt-get install g++-aarch64-linux-gnu
60
+ printf '%s\n' >> "$GITHUB_ENV" \
61
+ 'CC=aarch64-linux-gnu-gcc' 'CXX=aarch64-linux-gnu-g++'
62
+
63
+ - name : Build arm64 binary
64
+ run : npm_config_target=${{ env.CONFIG_TARGET }} npm x -- prebuildify --napi --arch arm64 -t 20.9.0
65
+
66
+ - name : Run tests
67
+ run : npm test
44
68
45
- - uses : actions/upload-artifact@v4
69
+ - name : Upload prebuilds
70
+ uses : actions/upload-artifact@v4
46
71
if : github.ref_type == 'tag' && matrix.node == 20
47
72
with :
48
73
path : prebuilds/**
0 commit comments