Skip to content

Commit cac80a9

Browse files
committed
Update CI.
1 parent f8a4324 commit cac80a9

File tree

1 file changed

+26
-58
lines changed

1 file changed

+26
-58
lines changed

.github/workflows/CI.yml

Lines changed: 26 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ on:
2121
branches: [main]
2222
jobs:
2323
build:
24-
if: "!contains(github.event.head_commit.message, 'skip ci')"
2524
strategy:
2625
fail-fast: false
2726
matrix:
@@ -71,28 +70,18 @@ jobs:
7170
target: armv7-unknown-linux-gnueabihf
7271
setup: |
7372
sudo apt-get update
74-
sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf -y
73+
sudo apt-get install gcc-arm-linux-gnueabihf -y
7574
build: |
76-
yarn build --target=armv7-unknown-linux-gnueabihf
75+
yarn build --target armv7-unknown-linux-gnueabihf
7776
arm-linux-gnueabihf-strip *.node
7877
- host: ubuntu-latest
7978
target: aarch64-linux-android
8079
build: |
81-
export CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER="${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang"
82-
export CC="${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang"
83-
export CXX="${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang++"
84-
export AR="${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar"
85-
export PATH="${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin:${PATH}"
8680
yarn build --target aarch64-linux-android
8781
${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip *.node
8882
- host: ubuntu-latest
8983
target: armv7-linux-androideabi
9084
build: |
91-
export CARGO_TARGET_ARMV7_LINUX_ANDROIDEABI_LINKER="${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi24-clang"
92-
export CC="${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi24-clang"
93-
export CXX="${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi24-clang++"
94-
export AR="${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar"
95-
export PATH="${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin:${PATH}"
9685
yarn build --target armv7-linux-androideabi
9786
${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip *.node
9887
- host: ubuntu-latest
@@ -106,25 +95,23 @@ jobs:
10695
- host: windows-latest
10796
target: aarch64-pc-windows-msvc
10897
build: yarn build --target aarch64-pc-windows-msvc
109-
name: stable - ${{ matrix.settings.target }} - node@16
98+
name: stable - ${{ matrix.settings.target }} - node@18
11099
runs-on: ${{ matrix.settings.host }}
111100
steps:
112101
- uses: actions/checkout@v3
113102
- name: Setup node
114103
uses: actions/setup-node@v3
115104
if: ${{ !matrix.settings.docker }}
116105
with:
117-
node-version: 16
106+
node-version: 18
118107
check-latest: true
119108
cache: yarn
120109
- name: Install
121-
uses: actions-rs/toolchain@v1
110+
uses: dtolnay/rust-toolchain@stable
122111
if: ${{ !matrix.settings.docker }}
123112
with:
124-
profile: minimal
125-
override: true
126113
toolchain: stable
127-
target: ${{ matrix.settings.target }}
114+
targets: ${{ matrix.settings.target }}
128115
- name: Cache cargo
129116
uses: actions/cache@v3
130117
with:
@@ -134,12 +121,11 @@ jobs:
134121
~/.cargo/git/db/
135122
.cargo-cache
136123
target/
137-
key: ${{ matrix.settings.target }}-cargo-registry
138-
- name: Cache NPM dependencies
139-
uses: actions/cache@v3
124+
key: ${{ matrix.settings.target }}-cargo-${{ matrix.settings.host }}
125+
- uses: goto-bus-stop/setup-zig@v2
126+
if: ${{ matrix.settings.target == 'armv7-unknown-linux-gnueabihf' }}
140127
with:
141-
path: .yarn/cache
142-
key: npm-cache-build-${{ matrix.settings.target }}-node@16
128+
version: 0.10.1
143129
- name: Setup toolchain
144130
run: ${{ matrix.settings.setup }}
145131
if: ${{ matrix.settings.setup }}
@@ -154,7 +140,7 @@ jobs:
154140
uses: actions/setup-node@v3
155141
if: matrix.settings.target == 'i686-pc-windows-msvc'
156142
with:
157-
node-version: 16
143+
node-version: 18
158144
check-latest: true
159145
cache: yarn
160146
architecture: x86
@@ -163,7 +149,7 @@ jobs:
163149
if: ${{ matrix.settings.docker }}
164150
with:
165151
image: ${{ matrix.settings.docker }}
166-
options: --user 0:0 -v ${{ github.workspace }}/.cargo-cache/git/db:/usr/local/cargo/git/db -v ${{ github.workspace }}/.cargo/registry/cache:/usr/local/cargo/registry/cache -v ${{ github.workspace }}/.cargo/registry/index:/usr/local/cargo/registry/index -v ${{ github.workspace }}:/build -w /build
152+
options: '--user 0:0 -v ${{ github.workspace }}/.cargo-cache/git/db:/usr/local/cargo/git/db -v ${{ github.workspace }}/.cargo/registry/cache:/usr/local/cargo/registry/cache -v ${{ github.workspace }}/.cargo/registry/index:/usr/local/cargo/registry/index -v ${{ github.workspace }}:/build -w /build'
167153
run: ${{ matrix.settings.build }}
168154
- name: Build
169155
run: ${{ matrix.settings.build }}
@@ -248,11 +234,6 @@ jobs:
248234
node-version: ${{ matrix.node }}
249235
check-latest: true
250236
cache: yarn
251-
- name: Cache NPM dependencies
252-
uses: actions/cache@v3
253-
with:
254-
path: .yarn/cache
255-
key: npm-cache-test-${{ matrix.settings.target }}-${{ matrix.node }}
256237
- name: Install dependencies
257238
run: yarn install
258239
- name: Download artifacts
@@ -285,11 +266,6 @@ jobs:
285266
node-version: ${{ matrix.node }}
286267
check-latest: true
287268
cache: yarn
288-
- name: Cache NPM dependencies
289-
uses: actions/cache@v3
290-
with:
291-
path: .yarn/cache
292-
key: npm-cache-test-linux-x64-gnu-${{ matrix.node }}
293269
- name: Install dependencies
294270
run: yarn install
295271
- name: Download artifacts
@@ -322,11 +298,6 @@ jobs:
322298
node-version: ${{ matrix.node }}
323299
check-latest: true
324300
cache: yarn
325-
- name: Cache NPM dependencies
326-
uses: actions/cache@v3
327-
with:
328-
path: .yarn/cache
329-
key: npm-cache-test-x86_64-unknown-linux-musl-${{ matrix.node }}
330301
- name: Install dependencies
331302
run: |
332303
yarn config set supportedArchitectures.libc "musl"
@@ -354,7 +325,6 @@ jobs:
354325
- '18'
355326
runs-on: ubuntu-latest
356327
steps:
357-
- run: docker run --rm --privileged multiarch/qemu-user-static:register --reset
358328
- uses: actions/checkout@v3
359329
- name: Download artifacts
360330
uses: actions/download-artifact@v3
@@ -364,21 +334,21 @@ jobs:
364334
- name: List packages
365335
run: ls -R .
366336
shell: bash
367-
- name: Cache NPM dependencies
368-
uses: actions/cache@v3
369-
with:
370-
path: .yarn/cache
371-
key: npm-cache-test-linux-aarch64-gnu-${{ matrix.node }}
372337
- name: Install dependencies
373338
run: |
374339
yarn config set supportedArchitectures.cpu "arm64"
375340
yarn config set supportedArchitectures.libc "glibc"
376341
yarn install
342+
- name: Set up QEMU
343+
uses: docker/setup-qemu-action@v2
344+
with:
345+
platforms: arm64
346+
- run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
377347
- name: Setup and run tests
378348
uses: addnab/docker-run-action@v3
379349
with:
380-
image: ghcr.io/napi-rs/napi-rs/nodejs:aarch64-${{ matrix.node }}
381-
options: '-v ${{ github.workspace }}:/build -w /build'
350+
image: node:${{ matrix.node }}-slim
351+
options: '--platform linux/arm64 -v ${{ github.workspace }}:/build -w /build'
382352
run: |
383353
set -e
384354
yarn test
@@ -389,7 +359,6 @@ jobs:
389359
- build
390360
runs-on: ubuntu-latest
391361
steps:
392-
- run: docker run --rm --privileged multiarch/qemu-user-static:register --reset
393362
- uses: actions/checkout@v3
394363
- name: Download artifacts
395364
uses: actions/download-artifact@v3
@@ -399,24 +368,23 @@ jobs:
399368
- name: List packages
400369
run: ls -R .
401370
shell: bash
402-
- name: Cache NPM dependencies
403-
uses: actions/cache@v3
404-
with:
405-
path: .yarn/cache
406-
key: npm-cache-test-linux-aarch64-musl-${{ matrix.node }}
407371
- name: Install dependencies
408372
run: |
409373
yarn config set supportedArchitectures.cpu "arm64"
410374
yarn config set supportedArchitectures.libc "musl"
411375
yarn install
376+
- name: Set up QEMU
377+
uses: docker/setup-qemu-action@v2
378+
with:
379+
platforms: arm64
380+
- run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
412381
- name: Setup and run tests
413382
uses: addnab/docker-run-action@v3
414383
with:
415-
image: multiarch/alpine:aarch64-latest-stable
416-
options: '-v ${{ github.workspace }}:/build -w /build'
384+
image: node:lts-alpine
385+
options: '--platform linux/arm64 -v ${{ github.workspace }}:/build -w /build'
417386
run: |
418387
set -e
419-
apk add nodejs npm yarn
420388
yarn test
421389
test-linux-arm-gnueabihf-binding:
422390
name: Test bindings on armv7-unknown-linux-gnueabihf - node@${{ matrix.node }}

0 commit comments

Comments
 (0)