File tree Expand file tree Collapse file tree 1 file changed +52
-0
lines changed
Expand file tree Collapse file tree 1 file changed +52
-0
lines changed Original file line number Diff line number Diff line change 1+ name : quality-gate
2+
3+ on :
4+ pull_request :
5+ types : [opened, synchronize, reopened, ready_for_review]
6+
7+ permissions :
8+ contents : read
9+
10+ jobs :
11+ changed-files :
12+ if : github.event.pull_request.draft == false
13+ runs-on : ubuntu-latest
14+ outputs :
15+ source_changed : ${{ steps.filter.outputs.source }}
16+ tests_changed : ${{ steps.filter.outputs.tests }}
17+ steps :
18+ - uses : actions/checkout@v4
19+
20+ - uses : dorny/paths-filter@v3
21+ id : filter
22+ with :
23+ filters : |
24+ source:
25+ - '**/*.ts'
26+ - '**/*.tsx'
27+ - '**/*.js'
28+ - '**/*.jsx'
29+ - '**/*.mjs'
30+ - '**/*.go'
31+ - '**/*.rs'
32+ - '**/*.py'
33+ - '**/*.sh'
34+ - '!**/*.test.*'
35+ - '!**/*.spec.*'
36+ tests:
37+ - '**/*.test.*'
38+ - '**/*.spec.*'
39+ - '**/test/**'
40+ - '**/tests/**'
41+
42+ enforce-test-delta :
43+ needs : changed-files
44+ if : needs.changed-files.outputs.source_changed == 'true'
45+ runs-on : ubuntu-latest
46+ steps :
47+ - name : Require test updates when source changes
48+ run : |
49+ if [ "${{ needs.changed-files.outputs.tests_changed }}" != "true" ]; then
50+ echo "Source files changed without accompanying test changes."
51+ exit 1
52+ fi
You can’t perform that action at this time.
0 commit comments