Skip to content

Commit

Permalink
ci: Fix linting getting skipped (#7043)
Browse files Browse the repository at this point in the history
* 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 <adamrtalbot@users.noreply.github.com>

* 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 <adamrtalbot@users.noreply.github.com>
  • Loading branch information
edmundmiller and adamrtalbot authored Nov 21, 2024
1 parent 0461b3e commit ece675b
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 51 deletions.
2 changes: 1 addition & 1 deletion .github/actions/nf-test-action/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ runs:
SENTIEON_LICSRVR_IP: ${{ env.SENTIEON_LICSRVR_IP }}
SENTIEON_AUTH_MECH: "GitHub Actions - token"
TAGS: ${{ inputs.tags && format('--tag {0}', inputs.tags) || '' }}
NFT_WORKDIR: "~"
run: |
NFT_WORKDIR=~ \
nf-test test \
--profile=${{ inputs.profile }} \
--tap=test.tap \
Expand Down
7 changes: 0 additions & 7 deletions .github/actions/self-hosted-cleanup/Dockerfile

This file was deleted.

1 change: 0 additions & 1 deletion .github/actions/self-hosted-cleanup/README.md

This file was deleted.

9 changes: 0 additions & 9 deletions .github/actions/self-hosted-cleanup/action.yml

This file was deleted.

8 changes: 0 additions & 8 deletions .github/actions/self-hosted-cleanup/entrypoint.sh

This file was deleted.

10 changes: 7 additions & 3 deletions .github/workflows/gpu-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,17 @@ jobs:
runs-on: ubuntu-latest
outputs:
# Expose detected tags as 'modules' and 'workflows' output variables
paths: ${{ steps.list.outputs.components }}
paths: ${{ steps.outputs.outputs.components }}
modules: ${{ steps.outputs.outputs.modules }}
subworkflows: ${{ steps.outputs.outputs.subworkflows}}
# Prod for version bumping
steps:
- name: Clean Workspace # Purge the workspace in case it's running on a self-hosted runner
uses: ./.github/actions/self-hosted-cleanup
run: |
ls -la ./
rm -rf ./* || true
rm -rf ./.??* || true
ls -la ./
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
Expand All @@ -70,7 +74,7 @@ jobs:
echo subworkflows=$(echo '${{ steps.list.outputs.components }}' | jq '. | map(select(contains("subworkflows"))) | map(gsub("subworkflows/nf-core/"; ""))') >> $GITHUB_OUTPUT
- name: debug
run: |
echo ${{ steps.filter.outputs.components }}
echo ${{ steps.outputs.outputs.components }}
echo ${{ steps.outputs.outputs.modules }}
echo ${{ steps.outputs.outputs.subworkflows }}
Expand Down
57 changes: 38 additions & 19 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ jobs:
name: nf-core-changes
runs-on: ubuntu-latest
outputs:
tags: ${{ steps.filter.outputs.changes }}
modules: ${{ steps.tags.outputs.modules }}
subworkflows: ${{ steps.tags.outputs.subworkflows }}
# https://github.com/dorny/paths-filter?tab=readme-ov-file#custom-processing-of-changed-files
modules: ${{ steps.filter.outputs.modules }}
modules_files: ${{ steps.module_names.outputs.result }}
subworkflows: ${{ steps.filter.outputs.subworkflows }}
subworkflows_files: ${{ steps.subworkflow_names.outputs.result }}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
Expand All @@ -61,29 +63,46 @@ jobs:
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3
id: filter
with:
filters: "tests/config/pytest_modules.yml"
filters: |
modules:
- 'modules/nf-core/**'
- 'tests/modules/nf-core/**'
subworkflows:
- 'subworkflows/nf-core/**'
- 'tests/subworkflows/nf-core/**'
token: ""
list-files: "json"

- name: Fetch module tags
id: tags
run: |
echo modules=$(echo '${{ steps.filter.outputs.changes }}' | jq -c '. | map(select(contains("modules"))) | map(gsub("modules/"; ""))') >> $GITHUB_OUTPUT
echo subworkflows=$(echo '${{ steps.filter.outputs.changes }}' | jq '. | map(select(contains("subworkflow"))) | map(gsub("subworkflows/"; ""))') >> $GITHUB_OUTPUT
- name: Get module name
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7
id: module_names
with:
script: |
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('/')))];
- name: Get subworkflow name
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7
id: subworkflow_names
with:
script: |
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('/')))];
- name: debug
run: |
echo ${{ steps.tags.outputs.modules }}
echo ${{ steps.tags.outputs.subworkflows }}
echo ${{ steps.filter.outputs.modules_files }}
echo ${{ steps.filter.outputs.subworkflows_files }}
echo ${{ steps.module_names.outputs.result }}
echo ${{ steps.subworkflow_names.outputs.result }}
nf-core-lint-modules:
runs-on: ${{ github.event.inputs.runners || 'self-hosted' }}
name: nf-core lint modules
needs: nf-core-changes
if: ${{ (needs.nf-core-changes.outputs.modules != '[]') }}
if: ${{ (needs.nf-core-changes.outputs.modules == 'true') }}
strategy:
fail-fast: false
matrix:
tags: "${{ fromJson(needs.nf-core-changes.outputs.modules) }}"
module: "${{ fromJson(needs.nf-core-changes.outputs.modules_files) }}"
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4

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

- name: Lint module ${{ matrix.tags }}
run: nf-core modules lint ${{ matrix.tags }}
- name: Lint module ${{ matrix.module }}
run: nf-core modules lint ${{ matrix.module }}

nf-core-lint-subworkflows:
runs-on: ubuntu-latest
name: nf-core lint subworkflows
needs: nf-core-changes
if: ${{ (needs.nf-core-changes.outputs.subworkflows != '[]') }}
if: ${{ (needs.nf-core-changes.outputs.subworkflows == 'true') }}
strategy:
fail-fast: false
matrix:
tags: "${{ fromJson(needs.nf-core-changes.outputs.subworkflows) }}"
subworkflow: "${{ fromJson(needs.nf-core-changes.outputs.subworkflows_files) }}"
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4

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

- name: Lint module ${{ matrix.tags }}
run: nf-core subworkflows lint ${{ matrix.tags }}
- name: Lint subworkflow ${{ matrix.subworkflow }}
run: nf-core subworkflows lint ${{ matrix.subworkflow }}

confirm-pass:
runs-on: ubuntu-latest
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/nf-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ jobs:
SENTIEON_ENCRYPTION_KEY: ${{ secrets.SENTIEON_ENCRYPTION_KEY }}
steps:
- name: Clean Workspace # Purge the workspace in case it's running on a self-hosted runner
uses: ./.github/actions/self-hosted-cleanup
run: |
ls -la ./
rm -rf ./* || true
rm -rf ./.??* || true
ls -la ./
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
Expand All @@ -73,5 +77,3 @@ jobs:
profile: ${{ matrix.profile }}
shard: ${{ matrix.shard }}
total_shards: ${{ env.TOTAL_SHARDS }}
- name: Clean Workspace # Purge the workspace in case it's running on a self-hosted runner
uses: ./.github/actions/self-hosted-cleanup

0 comments on commit ece675b

Please sign in to comment.