Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make creat-lint-wf composable and regularly update components in template #2733

Merged
merged 20 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 108 additions & 0 deletions .github/actions/create-lint-wf/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: "Create and lint nf-core pipeline"
description: "Create and lint nf-core pipeline"
inputs:
NXF_VER:
description: "Nextflow version"
required: true

runs:
using: "composite"
steps:
- name: go to subdirectory and change nextflow workdir
shell: bash
run: |
mkdir -p create-lint-wf
cd create-lint-wf
export NXF_WORK=$(pwd)

# Set up Nextflow
- name: Install Nextflow
uses: nf-core/setup-nextflow@v1
with:
version: ${{ matrix.NXF_VER }}

# Build a pipeline from the template
- name: nf-core create
shell: bash
run: |
mkdir -p create-lint-wf && cd create-lint-wf
export NXF_WORK=$(pwd)
nf-core --log-file log.txt create -n testpipeline -d "This pipeline is for testing" -a "Testing McTestface" --plain

# Try syncing it before we change anything
- name: nf-core sync
shell: bash
run: nf-core --log-file log.txt sync --dir nf-core-testpipeline/
working-directory: create-lint-wf

# Run code style linting
- name: run pre-commit
shell: bash
run: pre-commit run --all-files
working-directory: create-lint-wf

# Update modules to the latest version
- name: nf-core modules update
shell: bash
run: nf-core --log-file log.txt modules update --dir nf-core-testpipeline --all --no-preview
working-directory: create-lint-wf

# Remove TODO statements
- name: remove TODO
shell: bash
run: find nf-core-testpipeline -type f -exec sed -i '/TODO nf-core:/d' {} \;
working-directory: create-lint-wf

# Replace zenodo.XXXXXX to pass readme linting
- name: replace zenodo.XXXXXX
shell: bash
run: find nf-core-testpipeline -type f -exec sed -i 's/zenodo.XXXXXX/zenodo.123456/g' {} \;
working-directory: create-lint-wf

# Run nf-core linting
- name: nf-core lint
shell: bash
run: nf-core --verbose --log-file log.txt --hide-progress lint --dir nf-core-testpipeline --fail-ignored --fail-warned
working-directory: create-lint-wf

- name: nf-core bump-version to release
shell: bash
run: nf-core --log-file log.txt bump-version --dir nf-core-testpipeline/ 1.1
working-directory: create-lint-wf

- name: nf-core lint in release mode
shell: bash
run: nf-core --log-file log.txt --hide-progress lint --dir nf-core-testpipeline --fail-ignored --fail-warned --release
working-directory: create-lint-wf

- name: Upload log file artifact
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: nf-core-log-file-${{ matrix.NXF_VER }}
path: create-lint-wf/log.txt

- name: nf-core modules install
shell: bash
run: nf-core --log-file log.txt modules install fastqc --dir nf-core-testpipeline/ --force
working-directory: create-lint-wf

- name: nf-core modules install gitlab
shell: bash
run: nf-core --log-file log.txt modules --git-remote https://gitlab.com/nf-core/modules-test.git --branch branch-tester install fastp --dir nf-core-testpipeline/
working-directory: create-lint-wf

- name: nf-core modules list local
shell: bash
run: nf-core --log-file log.txt modules list local --dir nf-core-testpipeline/
working-directory: create-lint-wf

- name: nf-core modules list remote
shell: bash
run: nf-core --log-file log.txt modules list remote
working-directory: create-lint-wf

- name: nf-core modules list remote gitlab
shell: bash
run: nf-core --log-file log.txt modules --git-remote https://gitlab.com/nf-core/modules-test.git list remote
working-directory: create-lint-wf
82 changes: 7 additions & 75 deletions .github/workflows/create-lint-wf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ on:
push:
branches:
- dev
paths-ignore:
- "docs/**"
- "CHANGELOG.md"
pull_request:
release:
types: [published]
Expand Down Expand Up @@ -57,101 +60,30 @@ jobs:
python -m pip install --upgrade pip
pip install .

# Set up Nextflow
- name: Install Nextflow
uses: nf-core/setup-nextflow@dccbf847604cbc34610280d79644a02035d924ac # v1
- name: run create-lint-wf
uses: ./.github/actions/create-lint-wf
with:
version: ${{ matrix.NXF_VER }}

# Build a pipeline from the template
- name: nf-core create
run: |
mkdir create-lint-wf && cd create-lint-wf
export NXF_WORK=$(pwd)
nf-core --log-file log.txt create -n testpipeline -d "This pipeline is for testing" -a "Testing McTestface" --plain

# Try syncing it before we change anything
- name: nf-core sync
run: nf-core --log-file log.txt sync --dir nf-core-testpipeline/
working-directory: create-lint-wf
NXF_VER: ${{ matrix.NXF_VER }}

# Build a module from the template
- name: nf-core modules create
run: nf-core --log-file log.txt modules create bpipe --dir nf-core-testpipeline --author @nf-core-bot --label process_low --meta
working-directory: create-lint-wf

# Run code style linting
- name: run pre-commit
run: pre-commit run --all-files
working-directory: create-lint-wf

# Update modules to the latest version
- name: nf-core modules update
run: nf-core --log-file log.txt modules update --dir nf-core-testpipeline --all --no-preview
run: nf-core --verbose --log-file log.txt modules create bpipe --dir nf-core-testpipeline --author @nf-core-bot --label process_low --meta
working-directory: create-lint-wf

# Remove TODO statements
- name: remove TODO
run: find nf-core-testpipeline -type f -exec sed -i '/TODO nf-core:/d' {} \;
working-directory: create-lint-wf

# Replace zenodo.XXXXXX to pass readme linting
- name: replace zenodo.XXXXXX
run: find nf-core-testpipeline -type f -exec sed -i 's/zenodo.XXXXXX/zenodo.123456/g' {} \;
working-directory: create-lint-wf

# Run nf-core linting
- name: nf-core lint
run: nf-core --verbose --log-file log.txt --hide-progress lint --dir nf-core-testpipeline --fail-ignored --fail-warned
working-directory: create-lint-wf

# Run the other nf-core commands
- name: nf-core list
run: nf-core --log-file log.txt list
working-directory: create-lint-wf

# - name: nf-core licences
# run: nf-core --log-file log.txt licences nf-core-testpipeline

- name: nf-core schema
run: nf-core --log-file log.txt schema build --dir nf-core-testpipeline/ --no-prompts
working-directory: create-lint-wf

- name: nf-core bump-version
run: nf-core --log-file log.txt bump-version --dir nf-core-testpipeline/ 1.1
working-directory: create-lint-wf

- name: nf-core lint in release mode
run: nf-core --log-file log.txt --hide-progress lint --dir nf-core-testpipeline --fail-ignored --fail-warned --release
working-directory: create-lint-wf

- name: nf-core modules install
run: nf-core --log-file log.txt modules install fastqc --dir nf-core-testpipeline/ --force
working-directory: create-lint-wf

- name: nf-core modules install gitlab
run: nf-core --log-file log.txt modules --git-remote https://gitlab.com/nf-core/modules-test.git --branch branch-tester install fastp --dir nf-core-testpipeline/
working-directory: create-lint-wf

- name: nf-core modules list local
run: nf-core --log-file log.txt modules list local --dir nf-core-testpipeline/
working-directory: create-lint-wf

- name: nf-core modules list remote
run: nf-core --log-file log.txt modules list remote
working-directory: create-lint-wf

- name: nf-core modules list remote gitlab
run: nf-core --log-file log.txt modules --git-remote https://gitlab.com/nf-core/modules-test.git list remote
working-directory: create-lint-wf

- name: Upload log file artifact
if: ${{ always() }}
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4
with:
name: nf-core-log-file-${{ matrix.NXF_VER }}
path: create-lint-wf/log.txt

- name: Cleanup work directory
run: sudo rm -rf create-lint-wf
if: always()
3 changes: 3 additions & 0 deletions .github/workflows/create-test-lint-wf-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ on:
push:
branches:
- dev
paths-ignore:
- "docs/**"
- "CHANGELOG.md"
paths:
- nf_core/pipeline-template/**
pull_request:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/create-test-wf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ on:
push:
branches:
- dev
paths-ignore:
- "docs/**"
- "CHANGELOG.md"
pull_request:
release:
types: [published]
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
paths-ignore:
- "docs/**"
- "CHANGELOG.md"
- ".github/**"
release:
types: [published]
workflow_dispatch:
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/update_components_template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Update Modules Template

on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:

jobs:
update_modules:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.x"

- name: Install nf-core
run: pip install nf-core

- name: Update modules
run: nf-core modules update --all
working-directory: nf-core/pipeline-template

- name: Update subworkflows
run: nf-core subworkflows update --all
working-directory: nf-core/pipeline-template

# Commit the changes
- name: Commit changes
run: |
git config user.email "[email protected]"
git config user.name "nf-core-bot"
git add .
git status
git commit -m "[automated] Fix code linting"

# Open a new PR to dev with the changes
- name: Create PR
run: |
git checkout -b update-modules
git push origin update-modules
gh pr create --title "Update modules in template" --body "This PR updates the modules in the pipeline template" --base dev --head update-modules
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

### Linting

- make creat-lint-wf composable ([#2733](https://github.com/nf-core/tools/pull/2733))

### Modules

### General
Expand Down
3 changes: 2 additions & 1 deletion nf_core/lint/multiqc_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ def multiqc_config(self) -> Dict[str, List[str]]:
Basic template:

.. code-block:: yaml

report_comment: >
This report has been generated by the <a href="https://github.com/nf-core/quantms" target="_blank">nf-core/quantms</a>
analysis pipeline. For information about how to interpret these results, please see the
Expand All @@ -18,8 +19,8 @@ def multiqc_config(self) -> Dict[str, List[str]]:
order: -1000
nf-core-quantms-summary:
order: -1001

export_plots: true

"""
passed: List[str] = []
failed: List[str] = []
Expand Down
Loading