Skip to content

Commit

Permalink
ci: Keep running nf-core lint the way it was
Browse files Browse the repository at this point in the history
  • Loading branch information
Edmund Miller authored and Edmund Miller committed Sep 18, 2024
1 parent 5594071 commit c4f6257
Showing 1 changed file with 53 additions and 10 deletions.
63 changes: 53 additions & 10 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,53 @@ jobs:
- name: Run ECLint check
run: editorconfig-checker -exclude README.md $(git ls-files | grep -v test)

###################
# nf-core linting #
###################
nf-core-changes:
name: nf-core-changes
runs-on: ubuntu-latest
outputs:
tags: ${{ steps.filter.outputs.changes }}
modules: ${{ steps.tags.outputs.modules }}
subworkflows: ${{ steps.tags.outputs.subworkflows }}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
fetch-depth: 2 # To retrieve the preceding commit.

# TODO: change back to using dorny/paths-filter when https://github.com/dorny/paths-filter/pull/133 is implemented
- uses: mirpedrol/paths-filter@main
id: filter
with:
filters: "tests/config/pytest_modules.yml"
token: ""

- 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: debug
run: |
echo ${{ steps.tags.outputs.modules }}
echo ${{ steps.tags.outputs.subworkflows }}
nf-core-lint-modules:
runs-on: ${{ github.event.inputs.runners || 'self-hosted' }}
name: nf-core lint modules
name: nf-core-lint-modules
needs: nf-core-changes
if: ${{ (needs.nf-core-changes.outputs.modules != '[]')
strategy:
fail-fast: false
matrix:
tags: "${{ fromJson(needs.nf-core-changes.outputs.modules) }}"
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4

- name: Set up Python
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5
with:
python-version: "3.11"

Expand All @@ -94,7 +131,7 @@ jobs:
- name: Install pip
run: python -m pip install --upgrade pip

- uses: actions/setup-java@6a0805fcefea3d4657a47ac4c165951e33482018 # v4
- uses: actions/setup-java@2dfa2011c5b2a0f1489bf9e433881c92c1631f88 # v4
with:
distribution: "temurin"
java-version: "17"
Expand All @@ -105,24 +142,30 @@ 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 modules
run: nf-core --hide-progress modules lint -a
- name: Lint module ${{ matrix.tags }}
run: nf-core modules lint ${{ matrix.tags }}

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

- name: Set up Python
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5
with:
python-version: "3.11"

- name: Install pip
run: python -m pip install --upgrade pip

- uses: actions/setup-java@6a0805fcefea3d4657a47ac4c165951e33482018 # v4
- uses: actions/setup-java@2dfa2011c5b2a0f1489bf9e433881c92c1631f88 # v4
with:
distribution: "temurin"
java-version: "17"
Expand All @@ -133,5 +176,5 @@ 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 subworkflows
run: nf-core --hide-progress subworkflows lint -a
- name: Lint module ${{ matrix.tags }}
run: nf-core subworkflows lint ${{ matrix.tags }}

0 comments on commit c4f6257

Please sign in to comment.