Skip to content

Commit 76d483b

Browse files
committed
Update workflow
1 parent b50dfe7 commit 76d483b

1 file changed

Lines changed: 30 additions & 4 deletions

File tree

.github/workflows/run_affected_tests.yml

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,22 @@ on:
2424
push:
2525
paths:
2626
# List paths for which changes should trigger this workflow:
27-
- 'lib/**/'
27+
- 'lib/**/bin/**'
28+
- 'lib/**/data/**'
29+
- 'lib/**/etc/**'
30+
- 'lib/**/include/**'
31+
- 'lib/**/lib/**'
32+
- 'lib/**/src/**'
33+
- 'lib/**/test/**'
34+
35+
- 'lib/**/*.gyp'
36+
- 'lib/**/*.gypi'
37+
- 'lib/**/manifest.json'
38+
39+
- 'package.json'
40+
41+
# List paths for which changes should *not* trigger this workflow:
42+
- '!lib/**/_tools/**'
2843

2944
# Workflow jobs:
3045
jobs:
@@ -83,7 +98,18 @@ jobs:
8398
# Run JavaScript tests:
8499
- name: 'Run JavaScript tests'
85100
run: |
86-
directories="${{ steps.changed-directories.outputs.all_changed_files }}"
87-
echo "Changed directories: $directories"
88-
timeout-minutes: 5
101+
all_changed="${{ steps.changed-directories.outputs.all_changed_files }}"
89102
103+
# Find unique package directories:
104+
directories=$(echo "${directories}" | tr ' ' '\n' | sed -E 's/\/(bin|data|etc|include|lib|src|test)\/?$//' | uniq)
105+
106+
# Find all test files in changed packages:
107+
files=$(find ${directories} -wholename '**/test/test*.js' | grep -v '/fixtures/' | tr '\n' ' ')
108+
109+
# Exclude files residing in test fixtures directories:
110+
files=$(echo "${files}" | grep -v '/fixtures/')
111+
112+
if [[ -n "${file}" ]]; then
113+
make test-javascript-files FILES="${files}"
114+
fi
115+
timeout-minutes: 15

0 commit comments

Comments
 (0)