Skip to content

Commit

Permalink
test conditional linting ci
Browse files Browse the repository at this point in the history
  • Loading branch information
mirpedrol committed May 10, 2024
1 parent c834600 commit 7d7d287
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 11 deletions.
44 changes: 33 additions & 11 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@ jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4

- name: Set up Python 3.11
uses: actions/setup-python@v5
- name: Set up Python 3.12
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5
with:
python-version: 3.11
cache: "pip"
python-version: "3.12"

- name: Install pre-commit
run: pip install pre-commit
Expand All @@ -32,20 +31,43 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out pipeline code
uses: actions/checkout@v4
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4

- name: Install Nextflow
uses: nf-core/setup-nextflow@v1
uses: nf-core/setup-nextflow@v2

- uses: actions/setup-python@v5
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5
with:
python-version: "3.11"
python-version: "3.12"
architecture: "x64"

- name: read .nf-core.yml
uses: pietrobolcato/action-read-yaml@1.0.0
id: read_yml
with:
config: ${{ github.workspace }}/testpipeline/.nf-core.yaml

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install nf-core
pip install nf-core==${{ steps.read_yml.outputs['nf_core_version'] }}
- name: Check nf-core outdated
id: nf_core_outdated
run: pip list --outdated | grep nf-core

- name: Post nf-core last version comment
uses: marocchino/sticky-pull-request-comment@331f8f5b4215f0445d3c07b4967662a32a2d3e31 # v2
if: |
${{ steps.nf_core_outdated.outputs.stdout }} =~ 'nf-core'
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
header: update template
message: |
## :warning: New nf-core template version available
Your pipeline is using an old version of the nf-core template: ${{ steps.read_yml.outputs['nf_core_version'] }}.
Please update your pipeline to the latest version.
- name: Run nf-core lint
env:
Expand All @@ -60,7 +82,7 @@ jobs:

- name: Upload linting log file artifact
if: ${{ always() }}
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4
with:
name: linting-logs
path: |
Expand Down
1 change: 1 addition & 0 deletions .nf-core.yml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
repository_type: pipeline
nf_core_version: 1.13.1

0 comments on commit 7d7d287

Please sign in to comment.