@@ -70,16 +70,53 @@ jobs:
7070 - name : Run ECLint check
7171 run : editorconfig-checker -exclude README.md $(git ls-files | grep -v test)
7272
73+ # ##################
74+ # nf-core linting #
75+ # ##################
76+ nf-core-changes :
77+ name : nf-core-changes
78+ runs-on : ubuntu-latest
79+ outputs :
80+ tags : ${{ steps.filter.outputs.changes }}
81+ modules : ${{ steps.tags.outputs.modules }}
82+ subworkflows : ${{ steps.tags.outputs.subworkflows }}
83+ steps :
84+ - uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
85+ with :
86+ fetch-depth : 2 # To retrieve the preceding commit.
87+
88+ # TODO: change back to using dorny/paths-filter when https://github.com/dorny/paths-filter/pull/133 is implemented
89+ - uses : mirpedrol/paths-filter@main
90+ id : filter
91+ with :
92+ filters : " tests/config/pytest_modules.yml"
93+ token : " "
94+
95+ - name : Fetch module tags
96+ id : tags
97+ run : |
98+ echo modules=$(echo '${{ steps.filter.outputs.changes }}' | jq -c '. | map(select(contains("modules"))) | map(gsub("modules/"; ""))') >> $GITHUB_OUTPUT
99+ echo subworkflows=$(echo '${{ steps.filter.outputs.changes }}' | jq '. | map(select(contains("subworkflow"))) | map(gsub("subworkflows/"; ""))') >> $GITHUB_OUTPUT
100+
101+ - name : debug
102+ run : |
103+ echo ${{ steps.tags.outputs.modules }}
104+ echo ${{ steps.tags.outputs.subworkflows }}
105+
73106 nf-core-lint-modules :
74107 runs-on : ${{ github.event.inputs.runners || 'self-hosted' }}
75- name : nf-core lint modules
108+ name : nf-core-lint-modules
109+ needs : nf-core-changes
110+ if : ${{ (needs.nf-core-changes.outputs.modules != '[]') }}
76111 strategy :
77112 fail-fast : false
113+ matrix :
114+ tags : " ${{ fromJson(needs.nf-core-changes.outputs.modules) }}"
78115 steps :
79116 - uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
80117
81118 - name : Set up Python
82- uses : actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5
119+ uses : actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5
83120 with :
84121 python-version : " 3.11"
85122
94131 - name : Install pip
95132 run : python -m pip install --upgrade pip
96133
97- - uses : actions/setup-java@6a0805fcefea3d4657a47ac4c165951e33482018 # v4
134+ - uses : actions/setup-java@2dfa2011c5b2a0f1489bf9e433881c92c1631f88 # v4
98135 with :
99136 distribution : " temurin"
100137 java-version : " 17"
@@ -105,24 +142,30 @@ jobs:
105142 - name : Install nf-core tools development version
106143 run : python -m pip install --upgrade --force-reinstall git+https://github.com/nf-core/tools.git@dev
107144
108- - name : Lint modules
109- run : nf-core --hide-progress modules lint -a
145+ - name : Lint module ${{ matrix.tags }}
146+ run : nf-core modules lint ${{ matrix.tags }}
110147
111148 nf-core-lint-subworkflows :
112149 runs-on : ubuntu-latest
113- name : nf-core lint subworkflows
150+ name : nf-core-lint-modules
151+ needs : nf-core-changes
152+ if : ${{ (needs.nf-core-changes.outputs.subworkflows != '[]') }}
153+ strategy :
154+ fail-fast : false
155+ matrix :
156+ tags : " ${{ fromJson(needs.nf-core-changes.outputs.subworkflows) }}"
114157 steps :
115158 - uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
116159
117160 - name : Set up Python
118- uses : actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5
161+ uses : actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5
119162 with :
120163 python-version : " 3.11"
121164
122165 - name : Install pip
123166 run : python -m pip install --upgrade pip
124167
125- - uses : actions/setup-java@6a0805fcefea3d4657a47ac4c165951e33482018 # v4
168+ - uses : actions/setup-java@2dfa2011c5b2a0f1489bf9e433881c92c1631f88 # v4
126169 with :
127170 distribution : " temurin"
128171 java-version : " 17"
@@ -133,5 +176,5 @@ jobs:
133176 - name : Install nf-core tools development version
134177 run : python -m pip install --upgrade --force-reinstall git+https://github.com/nf-core/tools.git@dev
135178
136- - name : Lint subworkflows
137- run : nf-core --hide-progress subworkflows lint -a
179+ - name : Lint module ${{ matrix.tags }}
180+ run : nf-core subworkflows lint ${{ matrix.tags }}
0 commit comments