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
2 changes: 1 addition & 1 deletion .github/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@datastream/github-workflows",
"version": "0.7.0",
"version": "0.7.1",
"private": true,
"type": "module",
"engines": {
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-dast.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: https://registry.npmjs.org
cache: npm
- name: Install dependencies
run: |
npm ci --ignore-scripts
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: https://registry.npmjs.org
cache: npm
- name: Install dependencies
run: |
npm ci --ignore-scripts
Expand Down
37 changes: 34 additions & 3 deletions .github/workflows/test-perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,43 @@ concurrency:

env:
NODE_VERSION: 24.x
# ponytail: CI wants regression signal, not precise numbers; shrink tinybench's per-bench time floor (default 5000). Raise/unset for accurate local runs.
BENCH_TIME: "1000"

permissions:
contents: read

jobs:
unit:
setup:
name: List packages
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
packages: ${{ steps.list.outputs.packages }}
steps:
- name: Harden runner
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
with:
egress-policy: audit
disable-telemetry: true
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: List packages
id: list
run: |
echo "packages=$(find packages -mindepth 2 -maxdepth 2 -name 'index.perf.js' -printf '%h\n' | sed 's#packages/##' | jq -R -s -c 'split("\n") | map(select(length > 0))')" >> "$GITHUB_OUTPUT"

perf:
name: Tests (perf)
needs: setup
runs-on: ubuntu-latest
timeout-minutes: 30
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
package: ${{ fromJson(needs.setup.outputs.packages) }}

steps:
- name: Harden runner
Expand All @@ -34,12 +62,15 @@ jobs:
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: https://registry.npmjs.org
cache: npm
- name: Install dependencies
run: |
npm ci --ignore-scripts
- name: Build
run: |
npm run build --if-present
- name: Benchmarking tests
env:
PACKAGE: ${{ matrix.package }}
run: |
npm run test:perf
node --test --test-concurrency=1 "packages/${PACKAGE}/index.perf.js"
1 change: 1 addition & 0 deletions .github/workflows/test-types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: https://registry.npmjs.org
cache: npm
- name: Install dependencies
run: |
npm ci --ignore-scripts
Expand Down
10 changes: 6 additions & 4 deletions bin/esbuild
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ set -e

find packages -type f \( -name '*.node.mjs' -o -name '*.web.mjs' -o -name '*.node.mjs.map' -o -name '*.web.mjs.map' \) -delete

BUNDLE=""

for package in packages/*; do
modules=$(jq -r '.exports | keys[] as $k | "\($k)"' ${package}/package.json)
#length=${#modules[@]}
Expand All @@ -13,14 +15,14 @@ for package in packages/*; do
module="${module#./}"
fi
if [ -f ${package}/${module}.js ]; then
node_modules/.bin/esbuild --platform=node --target=node24 --format=esm ${package}/${module}.js --sourcemap=external --allow-overwrite --outfile=${package}/${module}.node.mjs
node_modules/.bin/esbuild --platform=browser --format=esm ${package}/${module}.js --sourcemap=external --allow-overwrite --outfile=${package}/${module}.web.mjs
node_modules/.bin/esbuild $BUNDLE --platform=node --target=node24 --format=esm ${package}/${module}.js --sourcemap=external --allow-overwrite --outfile=${package}/${module}.node.mjs
node_modules/.bin/esbuild $BUNDLE --platform=browser --format=esm ${package}/${module}.js --sourcemap=external --allow-overwrite --outfile=${package}/${module}.web.mjs
fi
if [ -f ${package}/${module}.node.js ]; then
node_modules/.bin/esbuild --platform=node --target=node24 --format=esm ${package}/${module}.node.js --sourcemap=external --allow-overwrite --outfile=${package}/${module}.node.mjs
node_modules/.bin/esbuild $BUNDLE --platform=node --target=node24 --format=esm ${package}/${module}.node.js --sourcemap=external --allow-overwrite --outfile=${package}/${module}.node.mjs
fi
if [ -f ${package}/${module}.web.js ]; then
node_modules/.bin/esbuild --platform=browser --format=esm ${package}/${module}.web.js --sourcemap=external --allow-overwrite --outfile=${package}/${module}.web.mjs
node_modules/.bin/esbuild $BUNDLE --platform=browser --format=esm ${package}/${module}.web.js --sourcemap=external --allow-overwrite --outfile=${package}/${module}.web.mjs
fi

done
Expand Down
2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/2.5.3/schema.json",
"$schema": "https://biomejs.dev/schemas/2.5.7/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
Expand Down
Loading
Loading