Skip to content

Disha/GitHub_ci_nf_test #20

Disha/GitHub_ci_nf_test

Disha/GitHub_ci_nf_test #20

Workflow file for this run

name: Run Linting
on: [push, pull_request]
env:
NXF_SINGULARITY_CACHEDIR: ${{ github.workspace }}/.singularity
NXF_SINGULARITY_LIBRARYDIR: ${{ github.workspace }}/.singularity
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NXF_VER: "25.10.2"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
nf-core-changes:
name: Detect changes
runs-on: ubuntu-latest
outputs:
modules: ${{ steps.filter.outputs.modules_files }}
subworkflows: ${{ steps.filter.outputs.subworkflows_files }}
steps:
- uses: actions/checkout@v6
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
modules:
- 'modules/ensembl/**'
subworkflows:
- 'subworkflows/ensembl/**'
list-files: "json"
- name: Extract module names
id: modules
run: |
echo '${{ steps.filter.outputs.modules_files }}' \
| jq -r 'map((split("/")[2] + "/" + split("/")[3])) | unique' \
> modules.json
echo "modules=$(cat modules.json)" >> $GITHUB_OUTPUT
nf-core-lint:
name: nf-core lint
runs-on: ubuntu-latest
needs: nf-core-changes
if: needs.nf-core-changes.outputs.modules != '[]'
strategy:
fail-fast: false
matrix:
module: ${{ fromJson(needs.nf-core-changes.outputs.modules || '[]') }}
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.14"
- uses: actions/cache@v5
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip
- uses: nf-core/setup-nextflow@v2
- name: Install nf-core tools
run: pip install --upgrade git+https://github.com/nf-core/tools.git@dev
- name: Lint modules
run: nf-core modules lint ${{ matrix.module }}
- name: Lint subworkflows
if: needs.nf-core-changes.outputs.subworkflows == 'true'
run: nf-core subworkflows lint --all