Skip to content

Commit

Permalink
Merge pull request #2781 from nf-core/dev
Browse files Browse the repository at this point in the history
Dev -> Master for 2.13
  • Loading branch information
mashehu authored Feb 20, 2024
2 parents 776089a + f4871ef commit b51c7d8
Show file tree
Hide file tree
Showing 160 changed files with 4,928 additions and 3,869 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
2 changes: 1 addition & 1 deletion .github/workflows/branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
# If the above check failed, post a comment on the PR explaining the failure
- name: Post PR comment
if: failure()
uses: mshick/add-pr-comment@v2
uses: mshick/add-pr-comment@b8f338c590a895d50bcbfa6c5859251edc8952fc # v2
with:
message: |
## This PR is against the `master` branch :x:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
)
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
token: ${{ secrets.NF_CORE_BOT_AUTH_TOKEN }}

Expand All @@ -34,7 +34,7 @@ jobs:
fi
gh pr checkout $PR_NUMBER
- uses: actions/setup-python@v5
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5
with:
python-version: "3.11"

Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:
echo "File changed: ${{ env.changed }}"
- name: Set up Python 3.11
uses: actions/setup-python@v5
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5
with:
python-version: 3.11
cache: "pip"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/clean-up.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v9
- uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # v9
with:
stale-issue-message: "This issue has been tagged as awaiting-changes or awaiting-feedback by an nf-core contributor. Remove stale label or add a comment otherwise this issue will be closed in 20 days."
stale-pr-message: "This PR has been tagged as awaiting-changes or awaiting-feedback by an nf-core contributor. Remove stale label or add a comment if it is still useful."
Expand Down
88 changes: 10 additions & 78 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 All @@ -26,7 +29,7 @@ env:

jobs:
MakeTestWorkflow:
runs-on: ${{ github.event.inputs.runners || 'self-hosted' }}
runs-on: ${{ github.event.inputs.runners || github.run_number > 1 && 'ubuntu-latest' || 'self-hosted' }}
env:
NXF_ANSI_LOG: false
strategy:
Expand All @@ -42,12 +45,12 @@ jobs:
export NXF_WORK=$(pwd)
# Get the repo code
- uses: actions/checkout@v4
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
name: Check out source-code repository

# Set up nf-core/tools
- name: Set up Python 3.11
uses: actions/setup-python@v5
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5
with:
python-version: 3.11
cache: pip
Expand All @@ -57,101 +60,30 @@ jobs:
python -m pip install --upgrade pip
pip install .
# Set up Nextflow
- name: Install Nextflow
uses: nf-core/setup-nextflow@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@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()
11 changes: 6 additions & 5 deletions .github/workflows/create-test-lint-wf-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ jobs:
- "template_skip_igenomes.yml"
- "template_skip_ci.yml"
runner:
- ${{ github.event.inputs.runners || 'self-hosted' }}
# use the runner given by the input if it is dispatched manually, run on github if it is a rerun or on self-hosted by default
- ${{ github.event.inputs.runners || github.run_number > 1 && 'ubuntu-latest' || 'self-hosted' }}
profile: ["self_hosted_runner"]
include:
- TEMPLATE: "template_skip_all.yml"
Expand All @@ -57,11 +58,11 @@ jobs:
cd create-lint-wf-template
export NXF_WORK=$(pwd)
- uses: actions/checkout@v4
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
name: Check out source-code repository

- name: Set up Python 3.11
uses: actions/setup-python@v5
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5
with:
python-version: 3.11

Expand All @@ -71,7 +72,7 @@ jobs:
pip install .
- name: Install Nextflow
uses: nf-core/setup-nextflow@v1
uses: nf-core/setup-nextflow@b9f764e8ba5c76b712ace14ecbfcef0e40ae2dd8 # v1
with:
version: latest-everything

Expand Down Expand Up @@ -154,7 +155,7 @@ jobs:

- name: Upload log file artifact
if: ${{ always() }}
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4
with:
name: nf-core-log-file-${{ matrix.TEMPLATE }}
path: create-test-lint-wf/artifact_files.tar
Expand Down
14 changes: 9 additions & 5 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 All @@ -26,7 +29,8 @@ env:

jobs:
RunTestWorkflow:
runs-on: ${{ github.event.inputs.runners || 'self-hosted' }}
# use the runner given by the input if it is dispatched manually, run on github if it is a rerun or on self-hosted by default
runs-on: ${{ github.event.inputs.runners || github.run_number > 1 && 'ubuntu-latest' || 'self-hosted' }}
env:
NXF_ANSI_LOG: false
strategy:
Expand All @@ -41,11 +45,11 @@ jobs:
cd create-test-wf
export NXF_WORK=$(pwd)
- uses: actions/checkout@v4
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
name: Check out source-code repository

- name: Set up Python 3.11
uses: actions/setup-python@v5
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5
with:
python-version: 3.11

Expand All @@ -55,7 +59,7 @@ jobs:
pip install .
- name: Install Nextflow
uses: nf-core/setup-nextflow@v1
uses: nf-core/setup-nextflow@b9f764e8ba5c76b712ace14ecbfcef0e40ae2dd8 # v1
with:
version: ${{ matrix.NXF_VER }}

Expand All @@ -68,7 +72,7 @@ jobs:
- name: Upload log file artifact
if: ${{ always() }}
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4
with:
name: nf-core-log-file-${{ matrix.NXF_VER }}
path: create-test-wf/log.txt
Expand Down
Loading

0 comments on commit b51c7d8

Please sign in to comment.