Skip to content

Commit

Permalink
Merge branch 'dev' into renovate/python-3.11-slim
Browse files Browse the repository at this point in the history
  • Loading branch information
mashehu authored Feb 9, 2024
2 parents a52503b + a5f8f4e commit 3d9e14e
Show file tree
Hide file tree
Showing 9 changed files with 175 additions and 78 deletions.
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@b9f764e8ba5c76b712ace14ecbfcef0e40ae2dd8 # 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@5d5d22a31266ced268874388b861e4b58bb5c2f3 # 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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- name: Set up Python
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5
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 "core@nf-co.re"
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
3 changes: 3 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 All @@ -18,6 +20,7 @@
- Update codecov/codecov-action digest to e0b68c6 ([#2728](https://github.com/nf-core/tools/pull/2728))
- Update pre-commit hook astral-sh/ruff-pre-commit to v0.2.1 ([#2730](https://github.com/nf-core/tools/pull/2730))
- Update python:3.11-slim Docker digest to 2a746e2 ([#2743](https://github.com/nf-core/tools/pull/2743))
- Update actions/setup-python action to v5 ([#2739](https://github.com/nf-core/tools/pull/2739))

## [v2.12.1 - Aluminium Wolf - Patch](https://github.com/nf-core/tools/releases/tag/2.12.1) - [2024-02-01]

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
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ jobs:
run: |
echo "REPO_LOWERCASE=${GITHUB_REPOSITORY,,}" >> ${GITHUB_ENV}
echo "REPOTITLE_LOWERCASE=$(basename ${GITHUB_REPOSITORY,,})" >> ${GITHUB_ENV}
echo "REPO_BRANCH=${{ github.event.inputs.testbranch || 'dev' }}" >> ${GITHUB_ENV}
echo "{% raw %}REPO_BRANCH=${{ github.event.inputs.testbranch || 'dev' }}" >> ${GITHUB_ENV}
- name: Download the pipeline
env:
NXF_SINGULARITY_CACHEDIR: ./
run: |
nf-core download {% raw %} ${{ env.REPO_LOWERCASE }} \
nf-core download ${{ env.REPO_LOWERCASE }} \
--revision ${{ env.REPO_BRANCH }} \
--outdir ./${{ env.REPOTITLE_LOWERCASE }} \
--compress "none" \
Expand Down

0 comments on commit 3d9e14e

Please sign in to comment.