77name : code-quality
88
99jobs :
10+ changes :
11+ runs-on : ubuntu-latest
12+ outputs :
13+ r : ${{ steps.filter.outputs.r }}
14+ c : ${{ steps.filter.outputs.c }}
15+ po : ${{ steps.filter.outputs.po }}
16+ md : ${{ steps.filter.outputs.md }}
17+ rd : ${{ steps.filter.outputs.rd }}
18+ steps :
19+ - uses : actions/checkout@v4
20+ with :
21+ fetch-depth : 0 # ensure diff against base is available for PRs
22+ - uses : dorny/paths-filter@v3
23+ id : filter
24+ with :
25+ filters : |
26+ r:
27+ - '**/*.R'
28+ - '**/*.Rmd'
29+ c:
30+ - '**/*.c'
31+ - '**/*.h'
32+ po:
33+ - 'po/**/*.po'
34+ md:
35+ - '**/*.md'
36+ - '**/*.Rmd'
37+ rd:
38+ - 'man/**/*.Rd'
39+
1040 lint-r :
41+ needs : changes
42+ if : needs.changes.outputs.r == 'true' || github.event_name == 'workflow_dispatch'
1143 runs-on : ubuntu-latest
1244 env :
1345 GITHUB_PAT : ${{ secrets.GITHUB_TOKEN }}
3264 LINTR_ERROR_ON_LINT : true
3365 R_LINTR_LINTER_FILE : .ci/.lintr
3466 lint-c :
67+ needs : changes
68+ if : needs.changes.outputs.c == 'true' || github.event_name == 'workflow_dispatch'
3569 runs-on : ubuntu-latest
3670 steps :
3771 - uses : actions/checkout@v4
4377 run : |
4478 Rscript .ci/lint.R .ci/linters/c src '[.][ch]$'
4579 lint-po :
80+ needs : changes
81+ if : needs.changes.outputs.po == 'true' || github.event_name == 'workflow_dispatch'
4682 runs-on : ubuntu-latest
4783 steps :
4884 - uses : actions/checkout@v4
@@ -56,13 +92,17 @@ jobs:
5692 run : |
5793 Rscript .ci/lint.R .ci/linters/po po '[.]po$'
5894 lint-md :
95+ needs : changes
96+ if : needs.changes.outputs.md == 'true' || github.event_name == 'workflow_dispatch'
5997 runs-on : ubuntu-latest
6098 steps :
6199 - uses : actions/checkout@v4
62100 - uses : r-lib/actions/setup-r@v2
63101 - name : Lint
64102 run : Rscript .ci/lint.R .ci/linters/md . '[.]R?md$'
65103 lint-rd :
104+ needs : changes
105+ if : needs.changes.outputs.rd == 'true' || github.event_name == 'workflow_dispatch'
66106 runs-on : ubuntu-latest
67107 steps :
68108 - uses : actions/checkout@v4
0 commit comments