Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 64 additions & 57 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,87 +27,94 @@ jobs:
target: x86_64-apple-darwin
architecture: x64
build: |
yarn build
npm run build
strip -x *.node
- host: windows-latest
build: yarn build
build: npm run build
target: x86_64-pc-windows-msvc
architecture: x64
- host: ubuntu-latest
target: x86_64-unknown-linux-gnu
architecture: x64
docker: |
docker pull $DOCKER_REGISTRY_URL/napi-rs/napi-rs/nodejs-rust:lts-debian
docker tag $DOCKER_REGISTRY_URL/napi-rs/napi-rs/nodejs-rust:lts-debian builder
build: |
docker run --rm -v ~/.cargo/git:/root/.cargo/git -v ~/.cargo/registry:/root/.cargo/registry -v $(pwd):/build -w /build builder yarn build && strip *.node
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine-zig
build: >-
set -e &&
rustup target add x86_64-unknown-linux-gnu &&
npm run build -- --target x86_64-unknown-linux-gnu --zig --zig-abi-suffix 2.12 &&
llvm-strip -x *.node
- host: macos-latest
target: aarch64-apple-darwin
build: |
yarn build --target=aarch64-apple-darwin
npm run build --target=aarch64-apple-darwin
strip -x *.node
- host: ubuntu-latest
architecture: x64
target: aarch64-unknown-linux-gnu
setup: |
sudo apt-get update
sudo apt-get install g++-aarch64-linux-gnu gcc-aarch64-linux-gnu -y
build: |
yarn build --target=aarch64-unknown-linux-gnu
aarch64-linux-gnu-strip *.node
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine-zig
build: >-
set -e &&
rustup target add aarch64-unknown-linux-gnu &&
npm run build -- --target aarch64-unknown-linux-gnu --zig --zig-abi-suffix 2.17 &&
llvm-strip -x *.node
name: stable - ${{ matrix.settings.target }} - node@16
runs-on: ${{ matrix.settings.host }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: 16
check-latest: true
cache: yarn
cache: npm
architecture: ${{ matrix.settings.architecture }}
- name: Install
uses: actions-rs/toolchain@v1
if: ${{ !matrix.settings.docker }}
with:
profile: minimal
override: true
toolchain: stable
target: ${{ matrix.settings.target }}
- name: Generate Cargo.lock
uses: actions-rs/cargo@v1
if: ${{ !matrix.settings.docker }}
with:
command: generate-lockfile
- name: Cache cargo registry
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.cargo/registry
key: ${{ matrix.settings.target }}-node@16-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
key: ${{ matrix.settings.target }}-cargo-registry
- name: Cache cargo index
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.cargo/git
key: ${{ matrix.settings.target }}-node@16-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }}
key: ${{ matrix.settings.target }}-cargo-index
- name: Cache NPM dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: node_modules
key: npm-cache-${{ matrix.settings.target }}-node@16-${{ hashFiles('yarn.lock') }}
- name: Pull latest image
run: ${{ matrix.settings.docker }}
env:
DOCKER_REGISTRY_URL: ghcr.io
if: ${{ matrix.settings.docker }}
key: npm-cache-build-${{ matrix.settings.target }}-node@16
- name: Setup toolchain
run: ${{ matrix.settings.setup }}
if: ${{ matrix.settings.setup }}
shell: bash
- name: Install dependencies
run: yarn install --ignore-scripts --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000
- name: Build
run: npm clean-install --ignore-scripts
- name: Build in docker
uses: addnab/docker-run-action@v3
if: ${{ matrix.settings.docker }}
with:
image: ${{ matrix.settings.docker }}
options: -v ${{ env.HOME }}/.cargo/git:/root/.cargo/git -v ${{ env.HOME }}/.cargo/registry:/root/.cargo/registry -v ${{ github.workspace }}:/build -w /build
run: ${{ matrix.settings.build }}

- name: 'Build'
run: ${{ matrix.settings.build }}
if: ${{ !matrix.settings.docker }}
shell: bash
- name: Upload artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: bindings-${{ matrix.settings.target }}
path: ${{ env.APP_NAME }}.*.node
Expand All @@ -128,30 +135,30 @@ jobs:
- '16'
runs-on: ${{ matrix.settings.host }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
check-latest: true
cache: yarn
cache: npm
- name: Cache NPM dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: node_modules
key: npm-cache-test-${{ matrix.settings.target }}-${{ matrix.node }}-${{ hashFiles('yarn.lock') }}
key: npm-cache-test-${{ matrix.settings.target }}-${{ matrix.node }}-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
run: yarn install --ignore-scripts --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000
run: npm clean-install --ignore-scripts
- name: Download artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: bindings-${{ matrix.settings.target }}
path: .
- name: List packages
run: ls -R .
shell: bash
- name: Test bindings
run: yarn test
run: npm test
test-linux-x64-gnu-binding:
name: Test bindings on Linux-x64-gnu - node@${{ matrix.node }}
needs:
Expand All @@ -171,14 +178,14 @@ jobs:
with:
node-version: ${{ matrix.node }}
check-latest: true
cache: yarn
cache: npm
- name: Cache NPM dependencies
uses: actions/cache@v2
with:
path: node_modules
key: npm-cache-test-linux-x64-gnu-${{ matrix.node }}-${{ hashFiles('yarn.lock') }}
key: npm-cache-test-linux-x64-gnu-${{ matrix.node }}-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
run: yarn install --ignore-scripts --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000
run: npm clean-install --ignore-scripts
- name: Download artifacts
uses: actions/download-artifact@v2
with:
Expand All @@ -188,7 +195,7 @@ jobs:
run: ls -R .
shell: bash
- name: Test bindings
run: docker run --rm -v $(pwd):/build -w /build node:${{ matrix.node }}-slim yarn test
run: docker run --rm -v $(pwd):/build -w /build node:${{ matrix.node }}-slim npm test
test-linux-aarch64-gnu-binding:
name: Test bindings on aarch64-unknown-linux-gnu - node@${{ matrix.node }}
needs:
Expand All @@ -203,30 +210,30 @@ jobs:
runs-on: ubuntu-latest
steps:
- run: docker run --rm --privileged multiarch/qemu-user-static:register --reset
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Download artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: bindings-aarch64-unknown-linux-gnu
path: .
- name: List packages
run: ls -R .
shell: bash
- name: Cache NPM dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: node_modules
key: npm-cache-test-linux-aarch64-gnu-${{ matrix.node }}-${{ hashFiles('yarn.lock') }}
key: npm-cache-test-linux-aarch64-gnu-${{ matrix.node }}-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
run: yarn install --ignore-scripts --ignore-platform --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000
run: npm clean-install --ignore-scripts
- name: Setup and run tests
uses: addnab/docker-run-action@v3
with:
image: ghcr.io/napi-rs/napi-rs/nodejs:aarch64-${{ matrix.node }}
options: '-v ${{ github.workspace }}:/build -w /build'
run: |
set -e
yarn test
npm test
ls -la
publish:
name: Publish
Expand All @@ -236,28 +243,28 @@ jobs:
- test-linux-x64-gnu-binding
- test-linux-aarch64-gnu-binding
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: 16
check-latest: true
cache: yarn
cache: npm
- name: Cache NPM dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: node_modules
key: npm-cache-ubuntu-latest-${{ hashFiles('yarn.lock') }}
key: npm-cache-ubuntu-latest-${{ hashFiles('package-lock.json') }}
restore-keys: |
npm-cache-
- name: Install dependencies
run: yarn install --ignore-scripts --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000
run: npm clean-install --ignore-scripts
- name: Download all artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Move artifacts
run: yarn artifacts
run: npm run artifacts
- name: List packages
run: ls -R ./npm
shell: bash
Expand Down
3 changes: 0 additions & 3 deletions npm/android-arm-eabi/README.md

This file was deleted.

18 changes: 0 additions & 18 deletions npm/android-arm-eabi/package.json

This file was deleted.

3 changes: 0 additions & 3 deletions npm/android-arm64/README.md

This file was deleted.

18 changes: 0 additions & 18 deletions npm/android-arm64/package.json

This file was deleted.

3 changes: 0 additions & 3 deletions npm/freebsd-x64/README.md

This file was deleted.

18 changes: 0 additions & 18 deletions npm/freebsd-x64/package.json

This file was deleted.

3 changes: 0 additions & 3 deletions npm/linux-arm-gnueabihf/README.md

This file was deleted.

18 changes: 0 additions & 18 deletions npm/linux-arm-gnueabihf/package.json

This file was deleted.

3 changes: 0 additions & 3 deletions npm/linux-arm64-musl/README.md

This file was deleted.

18 changes: 0 additions & 18 deletions npm/linux-arm64-musl/package.json

This file was deleted.

3 changes: 0 additions & 3 deletions npm/linux-x64-musl/README.md

This file was deleted.

Loading