Skip to content

Commit 66f1f9e

Browse files
author
mayintao3
committed
feat: use pnpm ci
1 parent 41fe764 commit 66f1f9e

File tree

1 file changed

+47
-43
lines changed

1 file changed

+47
-43
lines changed

.github/workflows/CI.yml

Lines changed: 47 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -32,59 +32,59 @@ jobs:
3232
- host: macos-latest
3333
target: x86_64-apple-darwin
3434
build: |
35-
yarn build --target x86_64-apple-darwin
35+
pnpm build --target x86_64-apple-darwin
3636
strip -x *.node
3737
- host: windows-latest
38-
build: yarn build
38+
build: pnpm build
3939
target: x86_64-pc-windows-msvc
4040
- host: ubuntu-latest
4141
target: x86_64-unknown-linux-gnu
4242
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian
4343
build: |-
4444
set -e &&
45-
yarn build --target x86_64-unknown-linux-gnu &&
45+
pnpm build --target x86_64-unknown-linux-gnu &&
4646
strip *.node
4747
- host: ubuntu-latest
4848
target: x86_64-unknown-linux-musl
4949
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
50-
build: set -e && yarn build && strip *.node
50+
build: set -e && pnpm build && strip *.node
5151
- host: macos-latest
5252
target: aarch64-apple-darwin
5353
build: |
54-
yarn build --target aarch64-apple-darwin
54+
pnpm build --target aarch64-apple-darwin
5555
strip -x *.node
5656
- host: ubuntu-latest
5757
target: aarch64-unknown-linux-gnu
5858
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64
5959
build: |-
6060
set -e &&
61-
yarn build --target aarch64-unknown-linux-gnu &&
61+
pnpm build --target aarch64-unknown-linux-gnu &&
6262
aarch64-unknown-linux-gnu-strip *.node
6363
- host: ubuntu-latest
6464
target: armv7-unknown-linux-gnueabihf
6565
setup: |
6666
sudo apt-get update
6767
sudo apt-get install gcc-arm-linux-gnueabihf -y
6868
build: |
69-
yarn build --target armv7-unknown-linux-gnueabihf
69+
pnpm build --target armv7-unknown-linux-gnueabihf
7070
arm-linux-gnueabihf-strip *.node
7171
- host: ubuntu-latest
7272
target: aarch64-linux-android
7373
build: |
74-
yarn build --target aarch64-linux-android
74+
pnpm build --target aarch64-linux-android
7575
${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip *.node
7676
- host: ubuntu-latest
7777
target: armv7-linux-androideabi
7878
build: |
79-
yarn build --target armv7-linux-androideabi
79+
pnpm build --target armv7-linux-androideabi
8080
${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip *.node
8181
- host: ubuntu-latest
8282
target: aarch64-unknown-linux-musl
8383
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
8484
build: |-
8585
set -e &&
8686
rustup target add aarch64-unknown-linux-musl &&
87-
yarn build --target aarch64-unknown-linux-musl &&
87+
pnpm build --target aarch64-unknown-linux-musl &&
8888
/aarch64-linux-musl-cross/bin/aarch64-linux-musl-strip *.node
8989
name: stable - ${{ matrix.settings.target }} - node@18
9090
runs-on: ${{ matrix.settings.host }}
@@ -96,7 +96,7 @@ jobs:
9696
with:
9797
node-version: 18
9898
check-latest: true
99-
cache: yarn
99+
cache: pnpm
100100
- name: Install
101101
uses: dtolnay/rust-toolchain@stable
102102
if: ${{ !matrix.settings.docker }}
@@ -122,7 +122,7 @@ jobs:
122122
if: ${{ matrix.settings.setup }}
123123
shell: bash
124124
- name: Install dependencies
125-
run: yarn install
125+
run: pnpm install
126126
- name: Build in docker
127127
uses: addnab/docker-run-action@v3
128128
if: ${{ matrix.settings.docker }}
@@ -161,9 +161,9 @@ jobs:
161161
# with:
162162
# node-version: ${{ matrix.node }}
163163
# check-latest: true
164-
# cache: yarn
164+
# cache: pnpm
165165
# - name: Install dependencies
166-
# run: yarn install
166+
# run: pnpm install
167167
# - name: Download artifacts
168168
# uses: actions/download-artifact@v3
169169
# with:
@@ -173,7 +173,7 @@ jobs:
173173
# run: ls -R .
174174
# shell: bash
175175
# - name: Test bindings
176-
# run: yarn test
176+
# run: pnpm test
177177
test-linux-x64-gnu-binding:
178178
name: Test bindings on Linux-x64-gnu - node@${{ matrix.node }}
179179
needs:
@@ -186,15 +186,19 @@ jobs:
186186
- '18'
187187
runs-on: ubuntu-latest
188188
steps:
189-
- uses: actions/checkout@v3
190-
- name: Setup node
191-
uses: actions/setup-node@v3
189+
- name: Checkout
190+
uses: actions/checkout@v4
191+
- name: Setup pnpm
192+
uses: pnpm/[email protected]
193+
with:
194+
version: 9
195+
- name: Setup Node.js ${{ matrix.node }}
196+
uses: actions/setup-node@v4
192197
with:
193198
node-version: ${{ matrix.node }}
194-
check-latest: true
195-
cache: yarn
199+
cache: 'pnpm'
196200
- name: Install dependencies
197-
run: yarn install
201+
run: pnpm install
198202
- name: Download artifacts
199203
uses: actions/download-artifact@v3
200204
with:
@@ -204,7 +208,7 @@ jobs:
204208
run: ls -R .
205209
shell: bash
206210
- name: Test bindings
207-
run: docker run --rm -v $(pwd):/build -w /build node:${{ matrix.node }}-slim yarn test
211+
run: docker run --rm -v $(pwd):/build -w /build node:${{ matrix.node }}-slim pnpm test
208212
test-linux-x64-musl-binding:
209213
name: Test bindings on x86_64-unknown-linux-musl - node@${{ matrix.node }}
210214
needs:
@@ -223,11 +227,11 @@ jobs:
223227
with:
224228
node-version: ${{ matrix.node }}
225229
check-latest: true
226-
cache: yarn
230+
cache: pnpm
227231
- name: Install dependencies
228232
run: |
229-
yarn config set supportedArchitectures.libc "musl"
230-
yarn install
233+
pnpm config set supportedArchitectures.libc "musl"
234+
pnpm install
231235
- name: Download artifacts
232236
uses: actions/download-artifact@v3
233237
with:
@@ -237,7 +241,7 @@ jobs:
237241
run: ls -R .
238242
shell: bash
239243
- name: Test bindings
240-
run: docker run --rm -v $(pwd):/build -w /build node:${{ matrix.node }}-alpine yarn test
244+
run: docker run --rm -v $(pwd):/build -w /build node:${{ matrix.node }}-alpine pnpm test
241245
test-linux-aarch64-gnu-binding:
242246
name: Test bindings on aarch64-unknown-linux-gnu - node@${{ matrix.node }}
243247
needs:
@@ -261,9 +265,9 @@ jobs:
261265
shell: bash
262266
- name: Install dependencies
263267
run: |
264-
yarn config set supportedArchitectures.cpu "arm64"
265-
yarn config set supportedArchitectures.libc "glibc"
266-
yarn install
268+
pnpm config set supportedArchitectures.cpu "arm64"
269+
pnpm config set supportedArchitectures.libc "glibc"
270+
pnpm install
267271
- name: Set up QEMU
268272
uses: docker/setup-qemu-action@v2
269273
with:
@@ -276,7 +280,7 @@ jobs:
276280
options: '--platform linux/arm64 -v ${{ github.workspace }}:/build -w /build'
277281
run: |
278282
set -e
279-
yarn test
283+
pnpm test
280284
ls -la
281285
test-linux-aarch64-musl-binding:
282286
name: Test bindings on aarch64-unknown-linux-musl - node@${{ matrix.node }}
@@ -295,9 +299,9 @@ jobs:
295299
shell: bash
296300
- name: Install dependencies
297301
run: |
298-
yarn config set supportedArchitectures.cpu "arm64"
299-
yarn config set supportedArchitectures.libc "musl"
300-
yarn install
302+
pnpm config set supportedArchitectures.cpu "arm64"
303+
pnpm config set supportedArchitectures.libc "musl"
304+
pnpm install
301305
- name: Set up QEMU
302306
uses: docker/setup-qemu-action@v2
303307
with:
@@ -310,7 +314,7 @@ jobs:
310314
options: '--platform linux/arm64 -v ${{ github.workspace }}:/build -w /build'
311315
run: |
312316
set -e
313-
yarn test
317+
pnpm test
314318
test-linux-arm-gnueabihf-binding:
315319
name: Test bindings on armv7-unknown-linux-gnueabihf - node@${{ matrix.node }}
316320
needs:
@@ -334,8 +338,8 @@ jobs:
334338
shell: bash
335339
- name: Install dependencies
336340
run: |
337-
yarn config set supportedArchitectures.cpu "arm"
338-
yarn install
341+
pnpm config set supportedArchitectures.cpu "arm"
342+
pnpm install
339343
- name: Set up QEMU
340344
uses: docker/setup-qemu-action@v2
341345
with:
@@ -348,7 +352,7 @@ jobs:
348352
options: '--platform linux/arm/v7 -v ${{ github.workspace }}:/build -w /build'
349353
run: |
350354
set -e
351-
yarn test
355+
pnpm test
352356
ls -la
353357
universal-macOS:
354358
name: Build universal macOS binary
@@ -362,9 +366,9 @@ jobs:
362366
with:
363367
node-version: 18
364368
check-latest: true
365-
cache: yarn
369+
cache: pnpm
366370
- name: Install dependencies
367-
run: yarn install
371+
run: pnpm install
368372
- name: Download macOS x64 artifact
369373
uses: actions/download-artifact@v3
370374
with:
@@ -376,7 +380,7 @@ jobs:
376380
name: bindings-aarch64-apple-darwin
377381
path: artifacts
378382
- name: Combine binaries
379-
run: yarn universal
383+
run: pnpm universal
380384
- name: Upload artifact
381385
uses: actions/upload-artifact@v3
382386
with:
@@ -401,15 +405,15 @@ jobs:
401405
with:
402406
node-version: 18
403407
check-latest: true
404-
cache: yarn
408+
cache: pnpm
405409
- name: Install dependencies
406-
run: yarn install
410+
run: pnpm install
407411
- name: Download all artifacts
408412
uses: actions/download-artifact@v3
409413
with:
410414
path: artifacts
411415
- name: Move artifacts
412-
run: yarn artifacts
416+
run: pnpm artifacts
413417
- name: List packages
414418
run: ls -R ./npm
415419
shell: bash

0 commit comments

Comments
 (0)