Skip to content

Commit

Permalink
Faster builds on Node CI tests (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
kylebarron authored Mar 15, 2022
1 parent dfe80d2 commit 636625c
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
node-version: "16"

- name: Build bundle
run: bash ./scripts/build.sh
run: bash ./scripts/build-node-tests.sh

- name: Install dev dependencies
run: yarn
Expand Down
35 changes: 35 additions & 0 deletions scripts/build-node-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#! /usr/bin/env bash

# Build script used in Node-only CI tests

rm -rf pkg pkg_node pkg_web

######################################
# ARROW 1 (arrow-rs) the default feature
# Build node version into pkg_node
echo "Building arrow-rs node"
wasm-pack build \
--dev \
--out-dir pkg \
--out-name node \
--target nodejs

######################################
# ARROW 2 turn on the feature manually
# Build node version into pkg2_node
echo "Building arrow2 node"
wasm-pack build \
--dev \
--out-dir pkg2_node \
--out-name node2 \
--target nodejs \
--no-default-features \
--features arrow2

# Copy files into pkg/
cp pkg2_node/{node2.d.ts,node2.js,node2_bg.wasm,node2_bg.wasm.d.ts} pkg/

# Update files array using JQ
jq '.files += ["node2.d.ts", "node2.js", "node2_bg.wasm", "node2_bg.wasm.d.ts"]' pkg/package.json > pkg/package.json.tmp
# Overwrite existing file
mv pkg/package.json.tmp pkg/package.json
2 changes: 1 addition & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env bash
rm -rf pkg pkg_node pkg_web
rm -rf pkg pkg_node pkg_web pkg2_node pkg2_web pkg2

######################################
# ARROW 1 (arrow-rs) the default feature
Expand Down

0 comments on commit 636625c

Please sign in to comment.