|
1 | | -name: nf-core linting |
2 | | -# This workflow is triggered on pushes and PRs to the repository. |
3 | | -# It runs the `nf-core pipelines lint` and markdown lint tests to ensure |
4 | | -# that the code meets the nf-core guidelines. |
| 1 | +name: Pipeline linting |
| 2 | +# Runs pre-commit (Prettier, editorconfig, etc.) on pushes to dev and on pull requests. |
5 | 3 | on: |
6 | 4 | push: |
7 | 5 | branches: |
|
26 | 24 |
|
27 | 25 | - name: Run pre-commit |
28 | 26 | run: pre-commit run --all-files |
29 | | - |
30 | | - nf-core: |
31 | | - runs-on: ubuntu-latest |
32 | | - steps: |
33 | | - - name: Check out pipeline code |
34 | | - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 |
35 | | - |
36 | | - - name: Install Nextflow |
37 | | - uses: nf-core/setup-nextflow@v2 |
38 | | - |
39 | | - - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 |
40 | | - with: |
41 | | - python-version: "3.12" |
42 | | - architecture: "x64" |
43 | | - |
44 | | - - name: read .nf-core.yml |
45 | | - uses: pietrobolcato/action-read-yaml@1.1.0 |
46 | | - id: read_yml |
47 | | - with: |
48 | | - config: ${{ github.workspace }}/.nf-core.yml |
49 | | - |
50 | | - - name: Install dependencies |
51 | | - run: | |
52 | | - python -m pip install --upgrade pip |
53 | | - pip install nf-core==${{ steps.read_yml.outputs['nf_core_version'] }} |
54 | | -
|
55 | | - - name: Run nf-core pipelines lint |
56 | | - if: ${{ github.base_ref != 'master' }} |
57 | | - env: |
58 | | - GITHUB_COMMENTS_URL: ${{ github.event.pull_request.comments_url }} |
59 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
60 | | - GITHUB_PR_COMMIT: ${{ github.event.pull_request.head.sha }} |
61 | | - run: nf-core -l lint_log.txt pipelines lint --dir ${GITHUB_WORKSPACE} --markdown lint_results.md |
62 | | - |
63 | | - - name: Run nf-core pipelines lint --release |
64 | | - if: ${{ github.base_ref == 'master' }} |
65 | | - env: |
66 | | - GITHUB_COMMENTS_URL: ${{ github.event.pull_request.comments_url }} |
67 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
68 | | - GITHUB_PR_COMMIT: ${{ github.event.pull_request.head.sha }} |
69 | | - run: nf-core -l lint_log.txt pipelines lint --release --dir ${GITHUB_WORKSPACE} --markdown lint_results.md |
70 | | - |
71 | | - - name: Save PR number |
72 | | - if: ${{ always() }} |
73 | | - run: echo ${{ github.event.pull_request.number }} > PR_number.txt |
74 | | - |
75 | | - - name: Upload linting log file artifact |
76 | | - if: ${{ always() }} |
77 | | - uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4 |
78 | | - with: |
79 | | - name: linting-logs |
80 | | - path: | |
81 | | - lint_log.txt |
82 | | - lint_results.md |
83 | | - PR_number.txt |
0 commit comments