Skip to content

Commit 57ac125

Browse files
committed
refactor(ci): replace dorny/paths-filter with native paths-ignore
Convert workflows using dorny/paths-filter with negative patterns to use GitHub's native paths-ignore feature: - test_wasm32.yml: Use paths-ignore for crates/oxc_linter/** - test_napi.yml: Use paths-ignore for linter, language_server, and editors - conformance.yml: Use paths-ignore for multiple non-core paths Benefits: - Simpler configuration without external action dependency - Better performance (workflow won't start if paths are ignored) - Cleaner code without conditional checks - Uses YAML anchors to avoid duplication between triggers Note: ast_changes.yml keeps dorny/paths-filter as it references an external YAML file which cannot be directly included with native filters.
1 parent e102cef commit 57ac125

File tree

3 files changed

+31
-48
lines changed

3 files changed

+31
-48
lines changed

.github/workflows/conformance.yml

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,27 @@ name: Conformance
22

33
permissions: {}
44

5+
# Define paths-ignore as YAML anchor to reuse between pull_request and push
6+
x-paths-ignore: &paths-ignore
7+
- '.github/**'
8+
- '.vscode/**'
9+
- 'apps/**'
10+
- 'editors/**'
11+
- 'napi/**'
12+
- 'npm/**'
13+
- 'crates/oxc_linter/**'
14+
- 'crates/oxc_language_server/**'
15+
- 'tasks/**'
16+
517
on:
618
workflow_dispatch:
719
pull_request:
820
types: [opened, synchronize]
21+
paths-ignore: *paths-ignore
922
push:
1023
branches:
1124
- main
25+
paths-ignore: *paths-ignore
1226

1327
concurrency:
1428
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
@@ -21,37 +35,17 @@ jobs:
2135
steps:
2236
- uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1
2337

24-
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
25-
id: filter
26-
with:
27-
predicate-quantifier: "every"
28-
filters: |
29-
src:
30-
- '!.github/**'
31-
- '!.vscode/**'
32-
- '!apps/**'
33-
- '!editors/**'
34-
- '!napi/**'
35-
- '!npm/**'
36-
- '!crates/oxc_linter/**'
37-
- '!crates/oxc_language_server/**'
38-
- '!tasks/**'
39-
4038
- uses: ./.github/actions/clone-submodules
41-
if: steps.filter.outputs.src == 'true'
4239

4340
- uses: oxc-project/setup-node@fdbf0dfd334c4e6d56ceeb77d91c76339c2a0885 # v1.0.4
44-
if: steps.filter.outputs.src == 'true'
4541

4642
- uses: oxc-project/setup-rust@d286d43bc1f606abbd98096666ff8be68c8d5f57 # v1.0.2
47-
if: steps.filter.outputs.src == 'true'
4843
with:
4944
cache-key: conformance
5045
save-cache: ${{ github.ref_name == 'main' }}
5146
tools: just
5247

5348
- name: Check Conformance
54-
if: steps.filter.outputs.src == 'true'
5549
run: |
5650
just update-transformer-fixtures
5751
just coverage

.github/workflows/test_napi.yml

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,21 @@ name: Test NAPI
22

33
permissions: {}
44

5+
# Define paths-ignore as YAML anchor to reuse between pull_request and push
6+
x-paths-ignore: &paths-ignore
7+
- 'crates/oxc_linter/**'
8+
- 'crates/oxc_language_server/**'
9+
- 'editors/**'
10+
511
on:
612
workflow_dispatch:
713
pull_request:
814
types: [opened, synchronize]
15+
paths-ignore: *paths-ignore
916
push:
1017
branches:
1118
- main
19+
paths-ignore: *paths-ignore
1220

1321
concurrency:
1422
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
@@ -20,41 +28,26 @@ jobs:
2028
runs-on: ubuntu-latest
2129
steps:
2230
- uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1
23-
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
24-
id: filter
25-
with:
26-
predicate-quantifier: "every"
27-
filters: |
28-
src:
29-
- '!crates/oxc_linter/**'
30-
- '!crates/oxc_language_server/**'
31-
- '!editors/**'
3231
- uses: oxc-project/setup-rust@d286d43bc1f606abbd98096666ff8be68c8d5f57 # v1.0.2
33-
if: steps.filter.outputs.src == 'true'
3432
with:
3533
cache-key: napi
3634
save-cache: ${{ github.ref_name == 'main' }}
3735
- uses: oxc-project/setup-node@fdbf0dfd334c4e6d56ceeb77d91c76339c2a0885 # v1.0.4
38-
if: steps.filter.outputs.src == 'true'
3936
- uses: ./.github/actions/clone-submodules
40-
if: steps.filter.outputs.src == 'true'
4137
with:
4238
babel: false
4339
prettier: false
44-
- if: steps.filter.outputs.src == 'true'
45-
name: Run tests in workspace
40+
- name: Run tests in workspace
4641
env:
4742
RUN_RAW_TESTS: "true"
4843
run: |
4944
rustup target add wasm32-wasip1-threads
5045
pnpm run build-test
5146
pnpm run test
52-
- if: steps.filter.outputs.src == 'true'
53-
name: Run e2e tests
47+
- name: Run e2e tests
5448
run: |
5549
pnpm install --frozen-lockfile
5650
pnpm run test
5751
working-directory: tasks/e2e
58-
- if: steps.filter.outputs.src == 'true'
59-
run: |
52+
- run: |
6053
git diff --exit-code # Must commit everything

.github/workflows/test_wasm32.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,19 @@ name: Test WASM32
22

33
permissions: {}
44

5+
# Define paths-ignore as YAML anchor to reuse between pull_request and push
6+
x-paths-ignore: &paths-ignore
7+
- 'crates/oxc_linter/**'
8+
59
on:
610
workflow_dispatch:
711
pull_request:
812
types: [opened, synchronize]
13+
paths-ignore: *paths-ignore
914
push:
1015
branches:
1116
- main
17+
paths-ignore: *paths-ignore
1218

1319
concurrency:
1420
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
@@ -20,29 +26,19 @@ jobs:
2026
runs-on: ubuntu-latest
2127
steps:
2228
- uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1
23-
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
24-
id: filter
25-
with:
26-
filters: |
27-
src:
28-
- '!crates/oxc_linter/**'
2929
- uses: oxc-project/setup-rust@d286d43bc1f606abbd98096666ff8be68c8d5f57 # v1.0.2
30-
if: steps.filter.outputs.src == 'true'
3130
with:
3231
cache-key: wasi
3332
save-cache: ${{ github.ref_name == 'main' }}
3433
- uses: oxc-project/setup-node@fdbf0dfd334c4e6d56ceeb77d91c76339c2a0885 # v1.0.4
35-
if: steps.filter.outputs.src == 'true'
3634
- name: Build
37-
if: steps.filter.outputs.src == 'true'
3835
run: |
3936
rustup target add wasm32-wasip1-threads
4037
pnpm napi build --target wasm32-wasip1-threads --cwd ./napi/parser
4138
pnpm napi build --target wasm32-wasip1-threads --cwd ./napi/transform
4239
pnpm napi build --target wasm32-wasip1-threads --cwd ./napi/minify
4340
git diff --exit-code # Must commit everything
4441
- name: Test wasi in browser
45-
if: steps.filter.outputs.src == 'true'
4642
working-directory: napi/parser
4743
run: |
4844
rm -rf *.wasm

0 commit comments

Comments
 (0)