Skip to content

Commit ece675b

Browse files
ci: Fix linting getting skipped (#7043)
* ci: Fix linting getting skipped * ci: Add list-files json * ci: Why do we need a Docker container again? * ci: Can't use a script if it doesn't exist yet Co-authored-by: adamrtalbot <[email protected]> * ci: Skip outputs if they're empty * style: Run lsp on fastqc * ci: Use files to skip extra steps * ci(lint): Get the module name nf-core/tools#3141 * ci: Add what shell to run on * ci: Clean up the names in the filter step * ci: Add hack to only lint the real changes * ci: Add more to debug step * ci(lint): Get fancy with map * ci: One more time * ci: Maybe? * ci: results => result * ci: Death by a thousand s's * ci: Use Set * ci: Use one at a time * ci(gpu): Update step name * ci: Remove clean workspace after run * ci: Why does that break things? * Revert "style: Run lsp on fastqc" This reverts commit da64fce. --------- Co-authored-by: adamrtalbot <[email protected]>
1 parent 0461b3e commit ece675b

File tree

8 files changed

+51
-51
lines changed

8 files changed

+51
-51
lines changed

.github/actions/nf-test-action/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ runs:
7373
SENTIEON_LICSRVR_IP: ${{ env.SENTIEON_LICSRVR_IP }}
7474
SENTIEON_AUTH_MECH: "GitHub Actions - token"
7575
TAGS: ${{ inputs.tags && format('--tag {0}', inputs.tags) || '' }}
76-
NFT_WORKDIR: "~"
7776
run: |
77+
NFT_WORKDIR=~ \
7878
nf-test test \
7979
--profile=${{ inputs.profile }} \
8080
--tap=test.tap \

.github/actions/self-hosted-cleanup/Dockerfile

Lines changed: 0 additions & 7 deletions
This file was deleted.

.github/actions/self-hosted-cleanup/README.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/actions/self-hosted-cleanup/action.yml

Lines changed: 0 additions & 9 deletions
This file was deleted.

.github/actions/self-hosted-cleanup/entrypoint.sh

Lines changed: 0 additions & 8 deletions
This file was deleted.

.github/workflows/gpu-tests.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,17 @@ jobs:
4343
runs-on: ubuntu-latest
4444
outputs:
4545
# Expose detected tags as 'modules' and 'workflows' output variables
46-
paths: ${{ steps.list.outputs.components }}
46+
paths: ${{ steps.outputs.outputs.components }}
4747
modules: ${{ steps.outputs.outputs.modules }}
4848
subworkflows: ${{ steps.outputs.outputs.subworkflows}}
4949
# Prod for version bumping
5050
steps:
5151
- name: Clean Workspace # Purge the workspace in case it's running on a self-hosted runner
52-
uses: ./.github/actions/self-hosted-cleanup
52+
run: |
53+
ls -la ./
54+
rm -rf ./* || true
55+
rm -rf ./.??* || true
56+
ls -la ./
5357
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
5458
with:
5559
fetch-depth: 0
@@ -70,7 +74,7 @@ jobs:
7074
echo subworkflows=$(echo '${{ steps.list.outputs.components }}' | jq '. | map(select(contains("subworkflows"))) | map(gsub("subworkflows/nf-core/"; ""))') >> $GITHUB_OUTPUT
7175
- name: debug
7276
run: |
73-
echo ${{ steps.filter.outputs.components }}
77+
echo ${{ steps.outputs.outputs.components }}
7478
echo ${{ steps.outputs.outputs.modules }}
7579
echo ${{ steps.outputs.outputs.subworkflows }}
7680

.github/workflows/lint.yml

Lines changed: 38 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,11 @@ jobs:
5050
name: nf-core-changes
5151
runs-on: ubuntu-latest
5252
outputs:
53-
tags: ${{ steps.filter.outputs.changes }}
54-
modules: ${{ steps.tags.outputs.modules }}
55-
subworkflows: ${{ steps.tags.outputs.subworkflows }}
53+
# https://github.com/dorny/paths-filter?tab=readme-ov-file#custom-processing-of-changed-files
54+
modules: ${{ steps.filter.outputs.modules }}
55+
modules_files: ${{ steps.module_names.outputs.result }}
56+
subworkflows: ${{ steps.filter.outputs.subworkflows }}
57+
subworkflows_files: ${{ steps.subworkflow_names.outputs.result }}
5658
steps:
5759
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
5860
with:
@@ -61,29 +63,46 @@ jobs:
6163
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3
6264
id: filter
6365
with:
64-
filters: "tests/config/pytest_modules.yml"
66+
filters: |
67+
modules:
68+
- 'modules/nf-core/**'
69+
- 'tests/modules/nf-core/**'
70+
subworkflows:
71+
- 'subworkflows/nf-core/**'
72+
- 'tests/subworkflows/nf-core/**'
6573
token: ""
74+
list-files: "json"
6675

67-
- name: Fetch module tags
68-
id: tags
69-
run: |
70-
echo modules=$(echo '${{ steps.filter.outputs.changes }}' | jq -c '. | map(select(contains("modules"))) | map(gsub("modules/"; ""))') >> $GITHUB_OUTPUT
71-
echo subworkflows=$(echo '${{ steps.filter.outputs.changes }}' | jq '. | map(select(contains("subworkflow"))) | map(gsub("subworkflows/"; ""))') >> $GITHUB_OUTPUT
76+
- name: Get module name
77+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7
78+
id: module_names
79+
with:
80+
script: |
81+
return [...new Set(${{ steps.filter.outputs.modules_files }}.map(path => path.replace('modules/nf-core/', '').split('/').slice(0,2).filter(x => x !== 'main.nf').join('/')))];
82+
83+
- name: Get subworkflow name
84+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7
85+
id: subworkflow_names
86+
with:
87+
script: |
88+
return [...new Set(${{ steps.filter.outputs.subworkflows_files }}.map(path => path.replace('subworkflows/nf-core/', '').split('/').slice(0,2).filter(x => x !== 'main.nf').join('/')))];
7289
7390
- name: debug
7491
run: |
75-
echo ${{ steps.tags.outputs.modules }}
76-
echo ${{ steps.tags.outputs.subworkflows }}
92+
echo ${{ steps.filter.outputs.modules_files }}
93+
echo ${{ steps.filter.outputs.subworkflows_files }}
94+
echo ${{ steps.module_names.outputs.result }}
95+
echo ${{ steps.subworkflow_names.outputs.result }}
7796
7897
nf-core-lint-modules:
7998
runs-on: ${{ github.event.inputs.runners || 'self-hosted' }}
8099
name: nf-core lint modules
81100
needs: nf-core-changes
82-
if: ${{ (needs.nf-core-changes.outputs.modules != '[]') }}
101+
if: ${{ (needs.nf-core-changes.outputs.modules == 'true') }}
83102
strategy:
84103
fail-fast: false
85104
matrix:
86-
tags: "${{ fromJson(needs.nf-core-changes.outputs.modules) }}"
105+
module: "${{ fromJson(needs.nf-core-changes.outputs.modules_files) }}"
87106
steps:
88107
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
89108

@@ -114,18 +133,18 @@ jobs:
114133
- name: Install nf-core tools development version
115134
run: python -m pip install --upgrade --force-reinstall git+https://github.com/nf-core/tools.git@dev
116135

117-
- name: Lint module ${{ matrix.tags }}
118-
run: nf-core modules lint ${{ matrix.tags }}
136+
- name: Lint module ${{ matrix.module }}
137+
run: nf-core modules lint ${{ matrix.module }}
119138

120139
nf-core-lint-subworkflows:
121140
runs-on: ubuntu-latest
122141
name: nf-core lint subworkflows
123142
needs: nf-core-changes
124-
if: ${{ (needs.nf-core-changes.outputs.subworkflows != '[]') }}
143+
if: ${{ (needs.nf-core-changes.outputs.subworkflows == 'true') }}
125144
strategy:
126145
fail-fast: false
127146
matrix:
128-
tags: "${{ fromJson(needs.nf-core-changes.outputs.subworkflows) }}"
147+
subworkflow: "${{ fromJson(needs.nf-core-changes.outputs.subworkflows_files) }}"
129148
steps:
130149
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
131150

@@ -148,8 +167,8 @@ jobs:
148167
- name: Install nf-core tools development version
149168
run: python -m pip install --upgrade --force-reinstall git+https://github.com/nf-core/tools.git@dev
150169

151-
- name: Lint module ${{ matrix.tags }}
152-
run: nf-core subworkflows lint ${{ matrix.tags }}
170+
- name: Lint subworkflow ${{ matrix.subworkflow }}
171+
run: nf-core subworkflows lint ${{ matrix.subworkflow }}
153172

154173
confirm-pass:
155174
runs-on: ubuntu-latest

.github/workflows/nf-test.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,11 @@ jobs:
6363
SENTIEON_ENCRYPTION_KEY: ${{ secrets.SENTIEON_ENCRYPTION_KEY }}
6464
steps:
6565
- name: Clean Workspace # Purge the workspace in case it's running on a self-hosted runner
66-
uses: ./.github/actions/self-hosted-cleanup
66+
run: |
67+
ls -la ./
68+
rm -rf ./* || true
69+
rm -rf ./.??* || true
70+
ls -la ./
6771
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
6872
with:
6973
fetch-depth: 0
@@ -73,5 +77,3 @@ jobs:
7377
profile: ${{ matrix.profile }}
7478
shard: ${{ matrix.shard }}
7579
total_shards: ${{ env.TOTAL_SHARDS }}
76-
- name: Clean Workspace # Purge the workspace in case it's running on a self-hosted runner
77-
uses: ./.github/actions/self-hosted-cleanup

0 commit comments

Comments
 (0)