From df4f749f72f6480b95c9c9be2b4dcdeeda3889b8 Mon Sep 17 00:00:00 2001 From: neverland Date: Sun, 8 Nov 2026 09:34:33 +0800 Subject: [PATCH 1/2] chore(ci): centralize path filters --- .github/filters.yml | 15 +++++++++++++++ .github/workflows/test.yml | 28 ++++++++++++---------------- 2 files changed, 27 insertions(+), 16 deletions(-) create mode 100644 .github/filters.yml diff --git a/.github/filters.yml b/.github/filters.yml new file mode 100644 index 00000000..b038bab2 --- /dev/null +++ b/.github/filters.yml @@ -0,0 +1,15 @@ +# Shared by test workflows and, where available, ecosystem CI. +# Exclude documentation by location: Markdown and metadata in fixtures and +# scaffolding templates are executable inputs and must still trigger tests. +# Consumers use token: '' for git-based PR detection without API permissions. +# Use predicate-quantifier: some-with-excludes in every consumer. +changed: + - '**' + - '!*.{md,mdx}' + - '!packages/*/{README*,CHANGELOG*,AGENTS}.md' + - '!{.agents,.vscode}/**' + - '!.github/ISSUE_TEMPLATE/**' + - '!.github/{FUNDING.yml,renovate.json,renovate.json5,PULL_REQUEST_TEMPLATE.md}' + - '!{skills-lock.json,skills.json,cspell.config.*}' + - '!scripts/dictionary.txt' + - '!website/**' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c7ebb5bf..09e8114f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,50 +29,46 @@ jobs: - uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3 id: changes + if: github.event_name != 'workflow_dispatch' with: - predicate-quantifier: 'every' - filters: | - changed: - - "!**/*.md" - - "!**/*.mdx" - - "!**/_meta.json" - - "!**/_nav.json" - - "!**/dictionary.txt" + token: '' + predicate-quantifier: 'some-with-excludes' + filters: .github/filters.yml - name: Setup Node.js - if: steps.changes.outputs.changed == 'true' + if: github.event_name == 'workflow_dispatch' || steps.changes.outputs.changed == 'true' uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7 with: node-version: 24.22.2 package-manager-cache: false - name: Install Pnpm - if: steps.changes.outputs.changed == 'true' + if: github.event_name == 'workflow_dispatch' || steps.changes.outputs.changed == 'true' uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 with: run_install: true - name: Build Packages - if: steps.changes.outputs.changed == 'true' + if: github.event_name == 'workflow_dispatch' || steps.changes.outputs.changed == 'true' run: node --run build - name: Run Rust Tests - if: steps.changes.outputs.changed == 'true' + if: github.event_name == 'workflow_dispatch' || steps.changes.outputs.changed == 'true' run: cargo test --profile ci --workspace --locked - name: Build Native Binding - if: steps.changes.outputs.changed == 'true' + if: github.event_name == 'workflow_dispatch' || steps.changes.outputs.changed == 'true' run: pnpm --filter rstack build:native:ci - name: Check Generated Native Files - if: steps.changes.outputs.changed == 'true' + if: github.event_name == 'workflow_dispatch' || steps.changes.outputs.changed == 'true' run: git diff --exit-code -- packages/rstack/binding.cjs packages/rstack/binding.d.cts - name: Run Test - if: steps.changes.outputs.changed == 'true' && runner.os != 'Windows' + if: (github.event_name == 'workflow_dispatch' || steps.changes.outputs.changed == 'true') && runner.os != 'Windows' run: node --run test # Run package tests serially on Windows to avoid resource contention between nested test workers. - name: Run Test (Windows) - if: steps.changes.outputs.changed == 'true' && runner.os == 'Windows' + if: (github.event_name == 'workflow_dispatch' || steps.changes.outputs.changed == 'true') && runner.os == 'Windows' run: pnpm --workspace-concurrency=1 --filter "./packages/**" test From af9506457e5c0552b00afd7ea55304e59ca68c6a Mon Sep 17 00:00:00 2001 From: neverland Date: Sun, 8 Nov 2026 12:08:21 +0800 Subject: [PATCH 2/2] chore(ci): simplify filter conditions --- .github/filters.yml | 9 +++------ .github/workflows/test.yml | 19 ++++++++++--------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/.github/filters.yml b/.github/filters.yml index b038bab2..3707778f 100644 --- a/.github/filters.yml +++ b/.github/filters.yml @@ -1,10 +1,7 @@ -# Shared by test workflows and, where available, ecosystem CI. -# Exclude documentation by location: Markdown and metadata in fixtures and -# scaffolding templates are executable inputs and must still trigger tests. -# Consumers use token: '' for git-based PR detection without API permissions. -# Use predicate-quantifier: some-with-excludes in every consumer. +# Keep fixture and template Markdown/metadata covered; exclude docs by location. +# Workflows use token: '' for git-based detection without PR API permissions. +# All rules are exclusions, combined with predicate-quantifier: every. changed: - - '**' - '!*.{md,mdx}' - '!packages/*/{README*,CHANGELOG*,AGENTS}.md' - '!{.agents,.vscode}/**' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 09e8114f..efcf0fad 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,46 +29,47 @@ jobs: - uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3 id: changes + # Manual runs leave the output unset; only 'false' skips later steps. if: github.event_name != 'workflow_dispatch' with: token: '' - predicate-quantifier: 'some-with-excludes' + predicate-quantifier: 'every' filters: .github/filters.yml - name: Setup Node.js - if: github.event_name == 'workflow_dispatch' || steps.changes.outputs.changed == 'true' + if: steps.changes.outputs.changed != 'false' uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7 with: node-version: 24.22.2 package-manager-cache: false - name: Install Pnpm - if: github.event_name == 'workflow_dispatch' || steps.changes.outputs.changed == 'true' + if: steps.changes.outputs.changed != 'false' uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 with: run_install: true - name: Build Packages - if: github.event_name == 'workflow_dispatch' || steps.changes.outputs.changed == 'true' + if: steps.changes.outputs.changed != 'false' run: node --run build - name: Run Rust Tests - if: github.event_name == 'workflow_dispatch' || steps.changes.outputs.changed == 'true' + if: steps.changes.outputs.changed != 'false' run: cargo test --profile ci --workspace --locked - name: Build Native Binding - if: github.event_name == 'workflow_dispatch' || steps.changes.outputs.changed == 'true' + if: steps.changes.outputs.changed != 'false' run: pnpm --filter rstack build:native:ci - name: Check Generated Native Files - if: github.event_name == 'workflow_dispatch' || steps.changes.outputs.changed == 'true' + if: steps.changes.outputs.changed != 'false' run: git diff --exit-code -- packages/rstack/binding.cjs packages/rstack/binding.d.cts - name: Run Test - if: (github.event_name == 'workflow_dispatch' || steps.changes.outputs.changed == 'true') && runner.os != 'Windows' + if: steps.changes.outputs.changed != 'false' && runner.os != 'Windows' run: node --run test # Run package tests serially on Windows to avoid resource contention between nested test workers. - name: Run Test (Windows) - if: (github.event_name == 'workflow_dispatch' || steps.changes.outputs.changed == 'true') && runner.os == 'Windows' + if: steps.changes.outputs.changed != 'false' && runner.os == 'Windows' run: pnpm --workspace-concurrency=1 --filter "./packages/**" test