Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
c87901d
docs: add `@shikiji/vitepress-twoslash` (#5445)
sapphi-red Apr 3, 2024
8521d29
feat: support explicit-resource-management (#5444)
TrickyPi Apr 3, 2024
5301dec
feat: show all cause in Error (#5422)
devohda Apr 3, 2024
5abe71b
4.14.0
lukastaegert Apr 3, 2024
459bfe1
chore: generate string constants from config (#5451)
TrickyPi Apr 4, 2024
66a0de1
chore(deps): lock file maintenance minor/patch updates (#5452)
renovate[bot] Apr 5, 2024
1b85663
chore(deps): lock file maintenance (#5453)
renovate[bot] Apr 5, 2024
edc1504
Remove inlining logic in AST (de-)serializer (#5455)
lukastaegert Apr 7, 2024
555982a
Improve error message when running on unsupported MUSL Linux (#5454)
lukastaegert Apr 7, 2024
0b665c3
4.14.1
lukastaegert Apr 7, 2024
b957e1d
Fix ppc64le target (#5460)
lukastaegert Apr 10, 2024
8c31e9b
chore: tweak the comment about files should not be edited (#5463)
TrickyPi Apr 10, 2024
eebf061
Add high-level architecture documentation (#5456)
lukastaegert Apr 10, 2024
e2a0539
chore(deps): lock file maintenance minor/patch updates (#5469)
renovate[bot] Apr 12, 2024
4e72323
chore(deps): lock file maintenance (#5470)
renovate[bot] Apr 12, 2024
2fdfe1c
chore(deps): update dependency eslint-plugin-unicorn to v52 (#5468)
renovate[bot] Apr 12, 2024
cfbaaaa
Ensure reexported namespaces do not prevent creation of default expor…
lukastaegert Apr 12, 2024
7275328
4.14.2
lukastaegert Apr 12, 2024
49ed6d9
Add linux arm musl build (#5471)
sapphi-red Apr 15, 2024
e64f3d8
4.14.3
lukastaegert Apr 15, 2024
4ca4ea9
chore(deps): lock file maintenance minor/patch updates (#5475)
renovate[bot] Apr 19, 2024
0bf4675
Try to run emulated smoke tests for Linux environments (#5477)
lukastaegert Apr 20, 2024
f24679e
Add ImportAttributesKey to choose keyword ("with" | "assert") (#5474)
doubleaa93 Apr 20, 2024
e6e05cd
4.15.0
lukastaegert Apr 20, 2024
5491ab4
feat: improve tree-shaking by propagate const parameter (#5443)
liuly0322 Apr 21, 2024
38fe707
4.16.0
lukastaegert Apr 21, 2024
190893a
fix: conditional/logical expression should request a new tree-shaking…
liuly0322 Apr 21, 2024
5d8019b
4.16.1
lukastaegert Apr 21, 2024
65bd332
docs(en): merging all conflicts
docschina-bot Apr 21, 2024
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
138 changes: 114 additions & 24 deletions .github/workflows/build-and-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,13 @@ jobs:
target: x86_64-apple-darwin
build: >-
set -e &&
npm run build:napi -- --release &&
strip -x *.node
npm run build:napi -- --release
- host: macos-latest
target: aarch64-apple-darwin
build: >-
set -e &&
rustup target add aarch64-apple-darwin &&
npm run build:napi -- --release --target aarch64-apple-darwin &&
strip -x *.node
npm run build:napi -- --release --target aarch64-apple-darwin

# Linux
- host: ubuntu-latest
Expand All @@ -121,14 +119,13 @@ jobs:
build: >-
set -e &&
rustup target add x86_64-unknown-linux-gnu &&
npm run build:napi -- --release --target x86_64-unknown-linux-gnu &&
strip *.node
npm run build:napi -- --release --target x86_64-unknown-linux-gnu
- host: ubuntu-latest
target: x86_64-unknown-linux-musl
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
build: >-
set -e &&
npm run build:napi -- --release && strip *.node
npm run build:napi -- --release
- host: ubuntu-latest
target: armv7-unknown-linux-gnueabihf
zig: true
Expand All @@ -137,8 +134,13 @@ jobs:
sudo apt-get install gcc-arm-linux-gnueabihf -y
build: >-
set -e &&
npm run build:napi -- --release --target armv7-unknown-linux-gnueabihf &&
arm-linux-gnueabihf-strip *.node
npm run build:napi -- --release --target armv7-unknown-linux-gnueabihf
- host: ubuntu-latest
target: armv7-unknown-linux-musleabihf
zig: true
build: >-
set -e &&
npm run build:napi -- --release --target armv7-unknown-linux-musleabihf
- host: ubuntu-latest
target: aarch64-unknown-linux-gnu
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64
Expand All @@ -147,8 +149,7 @@ jobs:
export JEMALLOC_SYS_WITH_LG_PAGE=16 &&
rustup default nightly-2023-10-05 &&
rustup target add aarch64-unknown-linux-gnu &&
npm run build:napi -- --release --target aarch64-unknown-linux-gnu &&
aarch64-unknown-linux-gnu-strip *.node
npm run build:napi -- --release --target aarch64-unknown-linux-gnu
- host: ubuntu-latest
target: aarch64-unknown-linux-musl
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
Expand All @@ -157,20 +158,17 @@ jobs:
export JEMALLOC_SYS_WITH_LG_PAGE=16 &&
rustup default nightly-2023-10-05 &&
rustup target add aarch64-unknown-linux-musl &&
RUSTFLAGS='-C target-feature=-crt-static -C linker=aarch64-linux-musl-gcc' npm run build:napi -- --release --target aarch64-unknown-linux-musl &&
/aarch64-linux-musl-cross/bin/aarch64-linux-musl-strip *.node
RUSTFLAGS='-C target-feature=-crt-static -C linker=aarch64-linux-musl-gcc' npm run build:napi -- --release --target aarch64-unknown-linux-musl
- host: ubuntu-latest
target: armv7-linux-androideabi
build: >-
set -e &&
npm run build:napi -- --release --target armv7-linux-androideabi &&
${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip *.node
npm run build:napi -- --release --target armv7-linux-androideabi
- host: ubuntu-latest
target: aarch64-linux-android
build: >-
set -e &&
npm run build:napi -- --release --target aarch64-linux-android &&
${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip *.node
npm run build:napi -- --release --target aarch64-linux-android
- host: ubuntu-latest
target: riscv64gc-unknown-linux-gnu
setup: |
Expand All @@ -179,8 +177,7 @@ jobs:
build: >-
set -e &&
rustup target add riscv64gc-unknown-linux-gnu &&
npm run build:napi -- --release --target riscv64gc-unknown-linux-gnu &&
riscv64-linux-gnu-strip *.node
npm run build:napi -- --release --target riscv64gc-unknown-linux-gnu
- host: ubuntu-latest
target: powerpc64le-unknown-linux-gnu
setup: |
Expand All @@ -189,8 +186,7 @@ jobs:
build: >-
set -e &&
export CARGO_TARGET_POWERPC64LE_UNKNOWN_LINUX_GNU_LINKER=powerpc64le-linux-gnu-gcc && rustup target add powerpc64le-unknown-linux-gnu &&
npm run build:napi -- --release --target powerpc64le-unknown-linux-gnu &&
powerpc64le-linux-gnu-strip *.node
npm run build:napi -- --release --target powerpc64le-unknown-linux-gnu
- host: ubuntu-latest
target: s390x-unknown-linux-gnu
setup: |
Expand All @@ -200,8 +196,7 @@ jobs:
set -e &&
export CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_LINKER=s390x-linux-gnu-gcc &&
rustup target add s390x-unknown-linux-gnu &&
npm run build:napi -- --release --target s390x-unknown-linux-gnu &&
s390x-linux-gnu-strip *.node
npm run build:napi -- --release --target s390x-unknown-linux-gnu
name: Build ${{ matrix.settings.name || matrix.settings.target }}
runs-on: ${{ matrix.settings.host }}
timeout-minutes: 30
Expand Down Expand Up @@ -273,6 +268,100 @@ jobs:
if-no-files-found: error
if: ${{ !matrix.settings.is-wasm-build }}

# smoke test for some architectures that do not receive the full test suite
smoke-test:
permissions:
packages: write # for caching container images
name: Smoke Test ${{ matrix.settings.target }}
needs:
- build
strategy:
fail-fast: false
matrix:
settings:
- arch: aarch64
distro: ubuntu_latest
target: aarch64-unknown-linux-gnu
- arch: aarch64
distro: alpine_latest
target: aarch64-unknown-linux-musl
- arch: armv7
distro: ubuntu_latest
target: armv7-unknown-linux-gnueabihf
# There is a bug that hangs the build when running npm
# - arch: armv7
# distro: alpine_latest
# target: armv7-unknown-linux-musleabihf
- arch: ppc64le
distro: ubuntu_latest
target: powerpc64le-unknown-linux-gnu
use-nvm: true
- arch: s390x
distro: ubuntu_latest
target: s390x-unknown-linux-gnu
use-nvm: true
# I could not find a way to install Node without compiling from source
# - arch: riscv64
# distro: ubuntu_latest
# target: riscv64gc-unknown-linux-gnu
runs-on: ubuntu-latest
timeout-minutes: 120
steps:
- name: Checkout Commit
uses: actions/checkout@v4
- name: Cache Node Modules
id: cache-node-modules
uses: actions/cache@v4
with:
path: node_modules
key: node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm ci --ignore-scripts
- name: Build JS
run: npm run build:cjs
- name: Download napi artifacts
uses: actions/download-artifact@v4
with:
name: bindings-${{ matrix.settings.target }}
path: dist/
- name: Run Smoke Test
uses: uraimo/run-on-arch-action@v2
with:
arch: ${{ matrix.settings.arch }}
distro: ${{ matrix.settings.distro }}
githubToken: ${{ github.token }}
install: |
case "${{ matrix.settings.distro }}" in
ubuntu*)
apt-get update -y
apt-get install -y curl git
if [[ -z "${{ matrix.settings.use-nvm }}" ]]; then
curl -fsSL https://deb.nodesource.com/setup_lts.x | bash -
apt-get install -y nodejs
fi
;;
alpine*)
apk add nodejs npm git
;;
esac
run: |
set -e
if [[ -n "${{ matrix.settings.use-nvm }}" ]]; then
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
source ~/.nvm/nvm.sh
nvm install --lts
fi
echo "Node: $(node -v)"
echo "npm: $(npm -v)"
git config --global --add safe.directory /home/runner/work/rollup/rollup
chmod +x dist/bin/rollup
dist/bin/rollup --version | grep -E 'rollup v[0-9]+\.[0-9]+\.[0-9]+'
mv dist dist-build
node dist-build/bin/rollup --config rollup.config.ts --configPlugin typescript --configTest --forceExit
cp dist-build/rollup.*.node dist/
dist/bin/rollup --version | grep -E 'rollup v[0-9]+\.[0-9]+\.[0-9]+'

test:
name: Test${{ matrix.additionalName || '' }} Node ${{ matrix.node }} (${{ matrix.settings.target }})
needs:
Expand Down Expand Up @@ -352,8 +441,9 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 15
needs:
- test
- lint
- test
- smoke-test
# This needs to be adapted for Rollup 5
if: startsWith(github.ref_name, 'v4')
steps:
Expand Down
Loading