|
18 | 18 | pull_request: null
|
19 | 19 | jobs:
|
20 | 20 | build:
|
21 |
| - if: '!contains(github.event.head_commit.message, ''skip ci'')' |
| 21 | + if: "!contains(github.event.head_commit.message, 'skip ci')" |
22 | 22 | strategy:
|
23 | 23 | fail-fast: false
|
24 | 24 | matrix:
|
|
42 | 42 | rustup target add x86_64-unknown-linux-gnu &&
|
43 | 43 | npm run build -- --target x86_64-unknown-linux-gnu --zig --zig-abi-suffix 2.12 &&
|
44 | 44 | llvm-strip -x *.node
|
| 45 | + - host: ubuntu-latest |
| 46 | + target: x86_64-unknown-linux-musl |
| 47 | + docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine |
| 48 | + build: set -e && npm run build && strip *.node |
45 | 49 | - host: macos-latest
|
46 | 50 | architecture: x64
|
47 | 51 | target: aarch64-apple-darwin
|
|
62 | 66 | rustup target add aarch64-unknown-linux-gnu &&
|
63 | 67 | npm run build -- --target aarch64-unknown-linux-gnu --zig --zig-abi-suffix 2.17 &&
|
64 | 68 | llvm-strip -x *.node
|
| 69 | + - host: ubuntu-latest |
| 70 | + target: aarch64-unknown-linux-musl |
| 71 | + docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine |
| 72 | + build: |- |
| 73 | + set -e && |
| 74 | + rustup target add aarch64-unknown-linux-musl && |
| 75 | + npm run build -- --target aarch64-unknown-linux-musl && |
| 76 | + /aarch64-linux-musl-cross/bin/aarch64-linux-musl-strip *.node |
65 | 77 | name: stable - ${{ matrix.settings.target }} - node@16
|
66 | 78 | runs-on: ${{ matrix.settings.host }}
|
67 | 79 | steps:
|
@@ -204,6 +216,44 @@ jobs:
|
204 | 216 | shell: bash
|
205 | 217 | - name: Test bindings
|
206 | 218 | run: docker run --rm -v $(pwd):/build -w /build node:${{ matrix.node }}-slim npm test
|
| 219 | + test-linux-x64-musl-binding: |
| 220 | + name: Test bindings on x86_64-unknown-linux-musl - node@${{ matrix.node }} |
| 221 | + needs: |
| 222 | + - build |
| 223 | + strategy: |
| 224 | + fail-fast: false |
| 225 | + matrix: |
| 226 | + node: |
| 227 | + - '12' |
| 228 | + - '14' |
| 229 | + - '16' |
| 230 | + - '18' |
| 231 | + runs-on: ubuntu-latest |
| 232 | + steps: |
| 233 | + - uses: actions/checkout@v3 |
| 234 | + - name: Setup node |
| 235 | + uses: actions/setup-node@v3 |
| 236 | + with: |
| 237 | + node-version: ${{ matrix.node }} |
| 238 | + check-latest: true |
| 239 | + cache: npm |
| 240 | + - name: Cache NPM dependencies |
| 241 | + uses: actions/cache@v3 |
| 242 | + with: |
| 243 | + path: node_modules |
| 244 | + key: npm-cache-test-x86_64-unknown-linux-musl-${{ matrix.node }}-${{ hashFiles('package-lock.json') }} |
| 245 | + - name: Install dependencies |
| 246 | + run: npm clean-install --ignore-scripts |
| 247 | + - name: Download artifacts |
| 248 | + uses: actions/download-artifact@v3 |
| 249 | + with: |
| 250 | + name: bindings-x86_64-unknown-linux-musl |
| 251 | + path: . |
| 252 | + - name: List packages |
| 253 | + run: ls -R . |
| 254 | + shell: bash |
| 255 | + - name: Test bindings |
| 256 | + run: docker run --rm -v $(pwd):/build -w /build node:${{ matrix.node }}-alpine npm test |
207 | 257 | test-linux-aarch64-gnu-binding:
|
208 | 258 | name: Test bindings on aarch64-unknown-linux-gnu - node@${{ matrix.node }}
|
209 | 259 | needs:
|
@@ -244,13 +294,47 @@ jobs:
|
244 | 294 | set -e
|
245 | 295 | npm test
|
246 | 296 | ls -la
|
| 297 | + test-linux-aarch64-musl-binding: |
| 298 | + name: Test bindings on aarch64-unknown-linux-musl - node@${{ matrix.node }} |
| 299 | + needs: |
| 300 | + - build |
| 301 | + runs-on: ubuntu-latest |
| 302 | + steps: |
| 303 | + - run: docker run --rm --privileged multiarch/qemu-user-static:register --reset |
| 304 | + - uses: actions/checkout@v3 |
| 305 | + - name: Download artifacts |
| 306 | + uses: actions/download-artifact@v3 |
| 307 | + with: |
| 308 | + name: bindings-aarch64-unknown-linux-musl |
| 309 | + path: . |
| 310 | + - name: List packages |
| 311 | + run: ls -R . |
| 312 | + shell: bash |
| 313 | + - name: Cache NPM dependencies |
| 314 | + uses: actions/cache@v3 |
| 315 | + with: |
| 316 | + path: node_modules |
| 317 | + key: npm-cache-test-linux-aarch64-musl-${{ matrix.node }}-${{ hashFiles('package-lock.json') }} |
| 318 | + - name: Install dependencies |
| 319 | + run: npm clean-install --ignore-scripts |
| 320 | + - name: Setup and run tests |
| 321 | + uses: addnab/docker-run-action@v3 |
| 322 | + with: |
| 323 | + image: multiarch/alpine:aarch64-latest-stable |
| 324 | + options: '-v ${{ github.workspace }}:/build -w /build' |
| 325 | + run: | |
| 326 | + set -e |
| 327 | + apk add nodejs npm |
| 328 | + npm test |
247 | 329 | publish:
|
248 | 330 | name: Publish
|
249 | 331 | runs-on: ubuntu-latest
|
250 | 332 | needs:
|
251 | 333 | - test-macOS-windows-binding
|
252 | 334 | - test-linux-x64-gnu-binding
|
| 335 | + - test-linux-x64-musl-binding |
253 | 336 | - test-linux-aarch64-gnu-binding
|
| 337 | + - test-linux-aarch64-musl-binding |
254 | 338 | steps:
|
255 | 339 | - uses: actions/checkout@v3
|
256 | 340 | - name: Setup node
|
|
0 commit comments