Skip to content

Commit 85e84b3

Browse files
committed
fix(ci): install dependencies inside docker container for cross-platform builds
1 parent 42e1bd2 commit 85e84b3

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

.github/workflows/CI.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,19 @@ jobs:
4040
- host: ubuntu-latest
4141
target: x86_64-unknown-linux-gnu
4242
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian
43-
build: npm run build -- --target x86_64-unknown-linux-gnu
43+
build: npm install && npm run build -- --target x86_64-unknown-linux-gnu
4444
- host: ubuntu-latest
4545
target: x86_64-unknown-linux-musl
4646
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
47-
build: npm run build -- --target x86_64-unknown-linux-musl
47+
build: npm install && npm run build -- --target x86_64-unknown-linux-musl
4848
- host: macos-latest
4949
target: aarch64-apple-darwin
5050
build: npm run build -- --target aarch64-apple-darwin
5151
- host: ubuntu-latest
5252
target: aarch64-unknown-linux-gnu
5353
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64
5454
build: |
55+
npm install &&
5556
rustup target add aarch64-unknown-linux-gnu &&
5657
npm run build -- --target aarch64-unknown-linux-gnu
5758
- host: ubuntu-latest
@@ -82,6 +83,7 @@ jobs:
8283
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
8384
build: |-
8485
set -e &&
86+
npm install &&
8587
rustup target add aarch64-unknown-linux-musl &&
8688
npm run build -- --target aarch64-unknown-linux-musl
8789
- host: windows-latest
@@ -131,19 +133,16 @@ jobs:
131133
run: ${{ matrix.settings.setup }}
132134
if: ${{ matrix.settings.setup }}
133135
shell: bash
134-
- name: Setup node x86
135-
if: matrix.settings.target == 'i686-pc-windows-msvc'
136-
run: npm config set arch ia32
137-
shell: bash
138-
- name: Install dependencies
139-
run: npm install
140136
- name: Setup node x86
141137
uses: actions/setup-node@v4
142138
if: matrix.settings.target == 'i686-pc-windows-msvc'
143139
with:
144140
node-version: 20
145141
cache: npm
146142
architecture: x86
143+
- name: Install dependencies
144+
if: ${{ !matrix.settings.docker }}
145+
run: npm install
147146
- name: Build in docker
148147
uses: addnab/docker-run-action@v3
149148
if: ${{ matrix.settings.docker }}

0 commit comments

Comments
 (0)