Skip to content

Commit

Permalink
Merge branch 'dev' into update-image-syntax-in-template
Browse files Browse the repository at this point in the history
  • Loading branch information
mashehu authored Jan 9, 2024
2 parents 403a6aa + ccf1104 commit 243084b
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 10 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/fix-linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ jobs:
with:
token: ${{ secrets.nf_core_bot_auth_token }}

# indication that the linting is being fixed
- name: React on comment
uses: peter-evans/create-or-update-comment@v3
with:
comment-id: ${{ github.event.comment.id }}
reactions: eyes

# Action runs on the issue comment, so we don't get the PR by default
# Use the gh cli to check out the PR
- name: Checkout Pull Request
Expand All @@ -34,9 +41,21 @@ jobs:
run: pip install pre-commit

- name: Run pre-commit
id: pre-commit
run: pre-commit run --all-files
continue-on-error: true

# indication that the linting has finished
- name: react if linting finished succesfully
if: ${{ steps.pre-commit.outcome }} == 'success'
uses: peter-evans/create-or-update-comment@v3
with:
comment-id: ${{ github.event.comment.id }}
reactions: green_check_mark

- name: Commit & push changes
id: commit-and-push
if: ${{ steps.pre-commit.outcome }} == 'failure'
run: |
git config user.email "core@nf-co.re"
git config user.name "nf-core-bot"
Expand All @@ -45,3 +64,19 @@ jobs:
git status
git commit -m "[automated] Fix code linting"
git push
- name: react if linting errors were fixed
if: ${{ steps.commit-and-push.outcome }} == 'success'
uses: peter-evans/create-or-update-comment@v3
with:
comment-id: ${{ github.event.comment.id }}
reactions: pencil2

- name: react if linting errors were not fixed
if: ${{ steps.commit-and-push.outcome }} == 'failure'
uses: peter-evans/create-or-update-comment@v3
with:
comment-id: ${{ github.event.comment.id }}
reactions: x
body: |
@${{ github.actor }} I tried to fix the linting errors, but it didn't work. Please fix them manually.
5 changes: 0 additions & 5 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ tasks:
command: |
unset JAVA_TOOL_OPTIONS
- name: Use pdiff for nf-test diff viewing
command: |
export NFT_DIFF="pdiff"
export NFT_DIFF_ARGS="--line-numbers --expand-tabs=2"
vscode:
extensions: # based on nf-core.nf-core-extensionpack
- codezombiech.gitignore # Language support for .gitignore files
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@

### Template

- Add a Github Action Workflow to the pipeline template that tests a successful download with 'nf-core download' ([#2618](https://github.com/nf-core/tools/pull/2618))
- Use `pre-commit` to lint files in GitHub CI ([#2635](https://github.com/nf-core/tools/pull/2635))
- Use pdiff also on gitpod for nf-test ([#2640](https://github.com/nf-core/tools/pull/2640))
- switch to new image syntax in readme ([#2645](https://github.com/nf-core/tools/pull/2645))
- Add conda channel order to nextflow.config ([#2094](https://github.com/nf-core/tools/pull/2094))

### Download

Expand All @@ -23,6 +25,7 @@
- Update pre-commit hook pre-commit/mirrors-mypy to v1.8.0 ([#2630](https://github.com/nf-core/tools/pull/2630))
- Update mshick/add-pr-comment action to v2 ([#2632](https://github.com/nf-core/tools/pull/2632))
- update python image version in docker file ([#2636](https://github.com/nf-core/tools/pull/2636))
- Set pdiff as nf-test differ in Docker image for Gitpod ([#2642](https://github.com/nf-core/tools/pull/2642))

# [v2.11.1 - Magnesium Dragon Patch](https://github.com/nf-core/tools/releases/tag/2.11) - [2023-12-20]

Expand Down
6 changes: 5 additions & 1 deletion nf_core/gitpod/gitpod.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,8 @@ RUN conda config --add channels defaults && \
RUN nextflow self-update

# Install nf-core
RUN python -m pip install .
RUN python -m pip install . --no-cache-dir

# Setup pdiff for nf-test diffs
RUN export NFT_DIFF="pdiff" && \
export NFT_DIFF_ARGS="--line-numbers --expand-tabs=2"
68 changes: 68 additions & 0 deletions nf_core/pipeline-template/.github/workflows/download_pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Test successful pipeline download with 'nf-core download'

# Run the workflow when:
# - dispatched manually
# - when a PR is opened or reopened to master branch
# - the head branch of the pull request is updated, i.e. if fixes for a release are pushed last minute to dev.

on:
workflow_dispatch:
pull_request:
types:
- opened
branches:
- master
pull_request_target:
branches:
- master

env:
NXF_ANSI_LOG: false

jobs:
download:
runs-on: ["self-hosted"]
steps:
- name: Install Nextflow
uses: nf-core/setup-nextflow@v1

- uses: actions/setup-python@v5
with:
python-version: "3.11"
architecture: "x64"
- uses: eWaterCycle/setup-singularity@v7
with:
singularity-version: 3.8.3

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install git+https://github.com/nf-core/tools.git@dev
- name: Get the repository name and current branch set as environment variable
run: |
echo "REPO_LOWERCASE=${GITHUB_REPOSITORY,,}" >> ${GITHUB_ENV}
echo "REPOTITLE_LOWERCASE=$(basename ${GITHUB_REPOSITORY,,})" >> ${GITHUB_ENV}
echo "REPO_BRANCH=${GITHUB_REF#refs/heads/}" >> ${GITHUB_ENV}
- name: Download the pipeline
env:
NXF_SINGULARITY_CACHEDIR: ./
run: |
nf-core download ${{ env.REPO_LOWERCASE }} \
--revision ${{ env.REPO_BRANCH }} \
--outdir ./${{ env.REPOTITLE_LOWERCASE }} \
--compress "none" \
--container-system 'singularity' \
--container-library "quay.io" -l "docker.io" -l "ghcr.io" \
--container-cache-utilisation 'amend' \
--download-configuration
- name: Inspect download
run: tree ./${{ env.REPOTITLE_LOWERCASE }}

- name: Run the downloaded pipeline
env:
NXF_SINGULARITY_CACHEDIR: ./
NXF_SINGULARITY_HOME_MOUNT: true
run: nextflow run ./${{ env.REPOTITLE_LOWERCASE }}/$( sed 's/\W/_/g' <<< ${{ env.REPO_BRANCH }}) -stub -profile test,singularity --outdir ./results
5 changes: 1 addition & 4 deletions nf_core/pipeline-template/.gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ tasks:
- name: unset JAVA_TOOL_OPTIONS
command: |
unset JAVA_TOOL_OPTIONS
- name: Use pdiff for nf-test diff viewing
command: |
export NFT_DIFF="pdiff"
export NFT_DIFF_ARGS="--line-numbers --expand-tabs=2"
vscode:
extensions: # based on nf-core.nf-core-extensionpack
- codezombiech.gitignore # Language support for .gitignore files
Expand Down
1 change: 1 addition & 0 deletions nf_core/pipeline-template/nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ profiles {
podman.enabled = false
shifter.enabled = false
charliecloud.enabled = false
channels = ['conda-forge', 'bioconda', 'defaults']
apptainer.enabled = false
}
mamba {
Expand Down

0 comments on commit 243084b

Please sign in to comment.