diff --git a/.github/actions/nf-test-action/action.yml b/.github/actions/nf-test-action/action.yml index 1fdfcd83a98..8cd79f21680 100644 --- a/.github/actions/nf-test-action/action.yml +++ b/.github/actions/nf-test-action/action.yml @@ -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 \ diff --git a/.github/actions/self-hosted-cleanup/Dockerfile b/.github/actions/self-hosted-cleanup/Dockerfile deleted file mode 100644 index 1a927fbc9d1..00000000000 --- a/.github/actions/self-hosted-cleanup/Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM quay.io/nf-core/ubuntu - -# Copies your code file from your action repository to the filesystem path `/` of the container -COPY entrypoint.sh /entrypoint.sh - -# Code file to execute when the docker container starts up (`entrypoint.sh`) -ENTRYPOINT ["/entrypoint.sh"] diff --git a/.github/actions/self-hosted-cleanup/README.md b/.github/actions/self-hosted-cleanup/README.md deleted file mode 100644 index 4d6282f2ffd..00000000000 --- a/.github/actions/self-hosted-cleanup/README.md +++ /dev/null @@ -1 +0,0 @@ -Copied from https://github.com/AutoModality/action-clean diff --git a/.github/actions/self-hosted-cleanup/action.yml b/.github/actions/self-hosted-cleanup/action.yml deleted file mode 100644 index 350566c3ec4..00000000000 --- a/.github/actions/self-hosted-cleanup/action.yml +++ /dev/null @@ -1,9 +0,0 @@ -# see package.yml for usage -name: 'Clean Workspace' -description: 'Deletes all files in the work directory.' -runs: - using: 'docker' - image: 'Dockerfile' -branding: - icon: delete - color: red diff --git a/.github/actions/self-hosted-cleanup/entrypoint.sh b/.github/actions/self-hosted-cleanup/entrypoint.sh deleted file mode 100644 index 368ebf922d0..00000000000 --- a/.github/actions/self-hosted-cleanup/entrypoint.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -set -e # fail on error - -# include hidden files -# https://askubuntu.com/questions/740805/how-can-i-remove-all-files-from-current-directory-using-terminal -shopt -s dotglob -rm -rf * diff --git a/.github/workflows/gpu-tests.yml b/.github/workflows/gpu-tests.yml index 2a60044b22b..2684d8373ca 100644 --- a/.github/workflows/gpu-tests.yml +++ b/.github/workflows/gpu-tests.yml @@ -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 @@ -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 }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 756894a27b0..b908d9aa2e3 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -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: @@ -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 @@ -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 @@ -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 diff --git a/.github/workflows/nf-test.yml b/.github/workflows/nf-test.yml index 303f121a7d4..5445a444531 100644 --- a/.github/workflows/nf-test.yml +++ b/.github/workflows/nf-test.yml @@ -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 @@ -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