Skip to content
Merged
Changes from 2 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
10 changes: 6 additions & 4 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ jobs:
name: Test
runs-on: ${{ matrix.os }}
needs: paths-filter
# only run if code relevant to unit tests was changed
if: needs.paths-filter.outputs.src-only == 'true'

strategy:
fail-fast: false
Expand All @@ -50,14 +48,17 @@ jobs:
npm install

- name: Lint
if: needs.paths-filter.outputs.src-only == 'true'
run: |
npm run lint

- name: Unit test
if: needs.paths-filter.outputs.src-only == 'true'
run: |
npm run test:unit
Copy link
Member

@JoshMock JoshMock Oct 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if: needs.paths-filter.outputs.src-only == 'true'
run: |
npm run test:unit
env:
CODE_CHANGED: ${{needs.paths-filter.outputs.src-only}}
run: |
[ "$CODE_CHANGED" = "true" ] && npm run test:unit || exit 0

This is the step that branch rules require to run. An if condition will skip it (I think). Using an environment variable ensures it always runs, and will just exit early if src-only isn't true.


- name: ECMAScript module test
if: needs.paths-filter.outputs.src-only == 'true'
run: |
npm run test:esm

Expand Down Expand Up @@ -90,8 +91,6 @@ jobs:
name: Test Bun
runs-on: ${{ matrix.os }}
needs: paths-filter
# only run if code relevant to unit tests was changed
if: needs.paths-filter.outputs.src-only == 'true'

strategy:
fail-fast: false
Expand All @@ -111,13 +110,16 @@ jobs:
bun install

- name: Lint
if: needs.paths-filter.outputs.src-only == 'true'
run: |
bun run lint

- name: Unit test
if: needs.paths-filter.outputs.src-only == 'true'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

run: |
bun run test:unit-bun

- name: ECMAScript module test
if: needs.paths-filter.outputs.src-only == 'true'
run: |
bun run test:esm