Skip to content

chore(deps): lock file maintenance #825

chore(deps): lock file maintenance

chore(deps): lock file maintenance #825

Workflow file for this run

name: CI
env:
DEBUG: napi:*
APP_NAME: oxc-node
OXC_LOG: "debug"
MACOSX_DEPLOYMENT_TARGET: "10.13"
TARGET_CC: clang
permissions: {}
on:
push:
branches:
- main
tags-ignore:
- "**"
paths-ignore:
- "**/*.md"
- LICENSE
- "**/*.gitignore"
- .editorconfig
- docs/**
pull_request: null
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1
- name: setup pnpm
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
- name: Setup node
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version: 22
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Lint
run: pnpm lint
- name: Clippy
run: cargo clippy --all-targets --all-features -- -D warnings
build-cli:
name: Build CLI
runs-on: ubuntu-latest
steps:
- uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1
- name: setup pnpm
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
- name: Setup node
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version: 22
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Build
run: pnpm --filter="@oxc-node/cli" build
- name: Test global install
run: |
npm install -g ./packages/cli
cd /tmp
which oxnode
oxnode --version
oxnode --help
- name: Upload artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: cli
path: ./packages/cli/dist
build:
strategy:
fail-fast: false
matrix:
settings:
- host: macos-latest
target: x86_64-apple-darwin
build: pnpm --filter=@oxc-node/core build --target x86_64-apple-darwin
- host: windows-latest
build: pnpm --filter=@oxc-node/core build --target x86_64-pc-windows-msvc
target: x86_64-pc-windows-msvc
- host: windows-latest
build: pnpm --filter=@oxc-node/core build --target i686-pc-windows-msvc
target: i686-pc-windows-msvc
- host: ubuntu-latest
target: x86_64-unknown-linux-gnu
build: pnpm --filter=@oxc-node/core build --target x86_64-unknown-linux-gnu --use-napi-cross
- host: ubuntu-latest
target: x86_64-unknown-linux-musl
build: pnpm --filter=@oxc-node/core build --target x86_64-unknown-linux-musl -x
- host: macos-latest
target: aarch64-apple-darwin
build: pnpm --filter=@oxc-node/core build --target aarch64-apple-darwin
- host: ubuntu-latest
target: aarch64-unknown-linux-gnu
build: pnpm --filter=@oxc-node/core build --target aarch64-unknown-linux-gnu --use-napi-cross
- host: ubuntu-latest
target: armv7-unknown-linux-gnueabihf
build: pnpm --filter=@oxc-node/core build --target armv7-unknown-linux-gnueabihf --use-napi-cross
- host: ubuntu-latest
target: aarch64-linux-android
build: pnpm --filter=@oxc-node/core build --target aarch64-linux-android
- host: ubuntu-latest
target: armv7-linux-androideabi
build: pnpm --filter=@oxc-node/core build --target armv7-linux-androideabi
- host: ubuntu-latest
target: aarch64-unknown-linux-musl
build: pnpm --filter=@oxc-node/core build --target aarch64-unknown-linux-musl -x
- host: windows-latest
target: aarch64-pc-windows-msvc
build: pnpm --filter=@oxc-node/core build --target aarch64-pc-windows-msvc
- host: ubuntu-latest
target: powerpc64le-unknown-linux-gnu
build: |
export CC=clang
pnpm --filter=@oxc-node/core build --target powerpc64le-unknown-linux-gnu --use-napi-cross
- host: ubuntu-latest
target: s390x-unknown-linux-gnu
build: |
export CC=clang
export CFLAGS="-fuse-ld=lld"
pnpm --filter=@oxc-node/core build --target s390x-unknown-linux-gnu --use-napi-cross
- host: ubuntu-latest
target: aarch64-unknown-linux-ohos
build: pnpm --filter=@oxc-node/core build --target aarch64-unknown-linux-ohos
- host: ubuntu-latest
target: wasm32-wasip1-threads
build: pnpm --filter=@oxc-node/core build --target wasm32-wasip1-threads
name: stable - ${{ matrix.settings.target }} - node@22
runs-on: ${{ matrix.settings.host }}
steps:
- uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1
- name: setup pnpm
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
- name: Setup node
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version: 22
cache: pnpm
- name: Install
run: rustup target add ${{ matrix.settings.target }}
- uses: oxc-project/setup-rust@d286d43bc1f606abbd98096666ff8be68c8d5f57 # v1.0.2
with:
cache-key: ${{ matrix.settings.target }}-${{ matrix.settings.host }}
save-cache: ${{ github.ref_name == 'main' }}
- name: Cache cross toolchain
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
with:
path: ~/.napi-rs
key: ${{ matrix.settings.target }}-cargo-${{ matrix.settings.host }}
- uses: mlugg/setup-zig@8d6198c65fb0feaa111df26e6b467fea8345e46f # v2.0.5
if: ${{ contains(matrix.settings.target, 'musl') }}
with:
version: 0.14.1
- name: Install cargo-zigbuild
uses: taiki-e/install-action@8ea32481661d5e04d602f215b94f17e4014b44f9 # v2.61.9
if: ${{ contains(matrix.settings.target, 'musl') }}
with:
tool: cargo-zigbuild
- name: Setup OpenHarmony toolchain
if: ${{ contains(matrix.settings.target, 'ohos') }}
uses: Boshen/setup-ohos-sdk@edb865a89a712f1f15dbad932dfa9cfce849d95c # v1.0.0
- name: Setup toolchain
run: ${{ matrix.settings.setup }}
if: ${{ matrix.settings.setup }}
shell: bash
- name: Install dependencies
run: pnpm install
- name: Setup node x86
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
if: matrix.settings.target == 'i686-pc-windows-msvc'
with:
node-version: 22
cache: pnpm
architecture: x86
- name: Build
run: ${{ matrix.settings.build }}
shell: bash
- name: Upload artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: bindings-${{ matrix.settings.target }}
path: |
./packages/core/*.node
./packages/core/*.wasm
if-no-files-found: error
build-freebsd:
name: Build FreeBSD
runs-on: ubuntu-latest
steps:
- uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1
- name: Build
id: build
uses: cross-platform-actions/action@e8a7b572196ff79ded1979dc2bb9ee67d1ddb252 # v0.29.0
env:
DEBUG: napi:*
RUSTUP_IO_THREADS: 1
with:
operating_system: freebsd
version: "14.2"
memory: 8G
cpu_count: 3
environment_variables: "DEBUG RUSTUP_IO_THREADS"
shell: bash
run: |
sudo pkg install -y -f curl node libnghttp2 npm cmake
curl https://sh.rustup.rs -sSf --output rustup.sh
sh rustup.sh -y --profile minimal --default-toolchain stable
source "$HOME/.cargo/env"
rustup install
echo "~~~~ rustc --version ~~~~"
rustc --version
echo "~~~~ node -v ~~~~"
node -v
pwd
ls -lah
whoami
env
sudo npm install -g corepack
sudo corepack enable
pnpm install
pnpm --filter=@oxc-node/core build --target x86_64-unknown-freebsd
pnpm --filter=@oxc-node/core export-oxc-runtime
pnpm --filter @oxc-node/cli build
pnpm rebuild
pnpm test
rm -rf node_modules
rm -rf target
- name: Upload artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: bindings-x86_64-unknown-freebsd
path: ./packages/core/*.node
if-no-files-found: error
test-macOS-windows-binding:
name: Test bindings on ${{ matrix.settings.target }} - node@${{ matrix.node }} - transform all@${{ matrix.transform_all }}
needs:
- build
- build-cli
strategy:
fail-fast: false
matrix:
settings:
- host: windows-latest
target: x86_64-pc-windows-msvc
architecture: x64
- host: windows-latest
target: i686-pc-windows-msvc
architecture: x86
- host: windows-11-arm
target: aarch64-pc-windows-msvc
architecture: arm64
- host: macos-latest
target: x86_64-apple-darwin
architecture: x64
- host: macos-latest
target: aarch64-apple-darwin
architecture: arm64
node:
- "20"
- "22"
transform_all:
- "true"
- "false"
exclude:
- settings:
target: i686-pc-windows-msvc
node: "20"
runs-on: ${{ matrix.settings.host }}
steps:
- uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1
- name: setup pnpm
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
- name: Setup node
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version: ${{ matrix.node }}
cache: pnpm
check-latest: true
architecture: ${{ matrix.settings.architecture }}
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
with:
name: cli
path: ./packages/cli/dist
- name: Install dependencies
run: pnpm install
- name: Download artifacts
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
with:
name: bindings-${{ matrix.settings.target }}
path: ./packages/core
- name: List packages
run: ls -R .
shell: bash
- name: Copy OXC Runtime
run: pnpm --filter=@oxc-node/core export-oxc-runtime
- name: Test bindings
run: pnpm test
env:
OXC_TRANSFORM_ALL: ${{ matrix.transform_all }}
test-linux-binding:
name: Test ${{ matrix.target }} - node@${{ matrix.node }}
needs:
- build
- build-cli
strategy:
fail-fast: false
matrix:
target:
- x86_64-unknown-linux-gnu
- x86_64-unknown-linux-musl
- aarch64-unknown-linux-gnu
- aarch64-unknown-linux-musl
- armv7-unknown-linux-gnueabihf
- s390x-unknown-linux-gnu
- powerpc64le-unknown-linux-gnu
node:
- "20"
- "22"
# Node.js on qemu segfaults on s390x and arm64v8 when using 24.04
# See also https://github.com/actions/runner-images/issues/11471
runs-on: ${{ contains(matrix.target, 'aarch64') && 'ubuntu-24.04-arm' || 'ubuntu-22.04' }}
steps:
- uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1
- name: setup pnpm
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
- name: Setup node
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version: ${{ matrix.node }}
cache: pnpm
- name: Output docker params
id: docker
run: |
node -e "
if ('${{ matrix.target }}'.startsWith('aarch64')) {
console.log('PLATFORM=linux/arm64')
} else if ('${{ matrix.target }}'.startsWith('armv7')) {
console.log('PLATFORM=linux/arm/v7')
} else if ('${{ matrix.target }}'.startsWith('powerpc64le')) {
console.log('PLATFORM=linux/ppc64le')
} else if ('${{ matrix.target }}'.startsWith('s390x')) {
console.log('PLATFORM=linux/s390x')
} else {
console.log('PLATFORM=linux/amd64')
}
" >> $GITHUB_OUTPUT
node -e "
if ('${{ matrix.target }}'.endsWith('-musl')) {
console.log('IMAGE=node:${{ matrix.node }}-alpine')
} else {
console.log('IMAGE=node:${{ matrix.node }}-slim')
}
" >> $GITHUB_OUTPUT
echo "PNPM_STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
with:
name: cli
path: ./packages/cli/dist
# use --force to download the all platform/arch dependencies
- name: Install dependencies
run: pnpm install --force
- name: Download artifacts
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
with:
name: bindings-${{ matrix.target }}
path: ./packages/core
- name: List packages
run: ls -R .
shell: bash
- name: Copy OXC Runtime
run: pnpm --filter=@oxc-node/core export-oxc-runtime
- name: Set up QEMU
if: ${{ !contains(matrix.target, 'aarch64') }}
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
with:
platforms: all
image: tonistiigi/binfmt:qemu-v7.0.0-28
- run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
if: ${{ !contains(matrix.target, 'aarch64') }}
- name: Test bindings
uses: addnab/docker-run-action@4f65fabd2431ebc8d299f8e5a018d79a769ae185 # v3
# Node.js on qemu randomly segfaults on powerpc64le
continue-on-error: ${{ matrix.target == 'powerpc64le-unknown-linux-gnu' }}
with:
image: ${{ steps.docker.outputs.IMAGE }}
options: -v ${{ steps.docker.outputs.PNPM_STORE_PATH }}:${{ steps.docker.outputs.PNPM_STORE_PATH }} -v ${{ github.workspace }}:${{ github.workspace }} -w ${{ github.workspace }} --platform ${{ steps.docker.outputs.PLATFORM }}
run: npm i -g corepack && corepack enable && pnpm test
test-wasi:
name: Test WASI target
needs:
- build
- build-cli
runs-on: ubuntu-latest
steps:
- uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1
- name: setup pnpm
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
- name: Setup node
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version: 22
cache: pnpm
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
with:
name: cli
path: ./packages/cli/dist
- name: Install dependencies
run: pnpm install --force
- name: Download artifacts
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
with:
name: bindings-wasm32-wasip1-threads
path: ./packages/core
- name: List packages
run: ls -R .
shell: bash
- name: Copy OXC Runtime
run: pnpm --filter=@oxc-node/core export-oxc-runtime
- name: Test bindings
run: pnpm test
env:
NAPI_RS_FORCE_WASI: 1
publish:
name: Publish
runs-on: ubuntu-latest
needs:
- lint
- test-macOS-windows-binding
- test-linux-binding
- build-freebsd
- test-wasi
permissions:
contents: write
id-token: write
steps:
- uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1
- name: setup pnpm
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
- name: Setup node
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version: 22
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Download all artifacts
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
with:
path: artifacts
- name: Prepare publish
run: |
pnpm napi create-npm-dirs --package-json-path packages/core/package.json
pnpm napi artifacts --package-json-path packages/core/package.json --build-output-dir packages/core
pnpm --filter=@oxc-node/core export-oxc-runtime
- name: List packages
run: ls -R ./npm
shell: bash
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
with:
name: cli
path: ./packages/cli/dist
- name: Publish
run: |
npm install -g npm
if git log -1 --pretty=%B | grep "^v\?[0-9]\+\.[0-9]\+\.[0-9]\+$";
then
pnpm napi pre-publish -t npm --package-json-path packages/core/package.json
pnpm publish -r --access public --no-git-checks
elif git log -1 --pretty=%B | grep "^v\?[0-9]\+\.[0-9]\+\.[0-9]\+";
then
pnpm napi pre-publish -t npm --package-json-path packages/core/package.json
pnpm -r publish --tag next --access public --no-git-checks
else
echo "Not a release, skipping publish"
fi