2022-02-18 06:55:14 +00:00
|
|
|
name: nf-core linting
|
|
|
|
# This workflow is triggered on pushes and PRs to the repository.
|
2022-03-23 13:57:56 +00:00
|
|
|
# It runs the `nf-core lint` and markdown lint tests to ensure
|
|
|
|
# that the code meets the nf-core guidelines.
|
2022-02-18 06:55:14 +00:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
pull_request:
|
|
|
|
release:
|
|
|
|
types: [published]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
EditorConfig:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
2022-03-15 21:05:37 +00:00
|
|
|
- uses: actions/setup-node@v2
|
2022-02-18 06:55:14 +00:00
|
|
|
|
|
|
|
- name: Install editorconfig-checker
|
|
|
|
run: npm install -g editorconfig-checker
|
|
|
|
|
|
|
|
- name: Run ECLint check
|
2022-03-23 13:57:56 +00:00
|
|
|
run: editorconfig-checker -exclude README.md $(find .* -type f | grep -v '.git\|.py\|.md\|json\|yml\|yaml\|html\|css\|work\|.nextflow\|build\|nf_core.egg-info\|log.txt\|Makefile')
|
2022-02-18 06:55:14 +00:00
|
|
|
|
2022-03-23 13:57:56 +00:00
|
|
|
Prettier:
|
2022-02-18 06:55:14 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-03-23 13:57:56 +00:00
|
|
|
- uses: actions/checkout@v2
|
2022-02-18 06:55:14 +00:00
|
|
|
|
2022-03-23 13:57:56 +00:00
|
|
|
- uses: actions/setup-node@v2
|
2022-02-18 06:55:14 +00:00
|
|
|
|
2022-03-23 13:57:56 +00:00
|
|
|
- name: Install Prettier
|
|
|
|
run: npm install -g prettier
|
2022-02-18 06:55:14 +00:00
|
|
|
|
2022-03-23 13:57:56 +00:00
|
|
|
- name: Run Prettier --check
|
|
|
|
run: prettier --check ${GITHUB_WORKSPACE}
|
2022-02-18 06:55:14 +00:00
|
|
|
|
2022-08-30 13:43:03 +00:00
|
|
|
PythonBlack:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Check code lints with Black
|
|
|
|
uses: psf/black@stable
|
|
|
|
|
|
|
|
# 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@v1
|
|
|
|
with:
|
|
|
|
message: |
|
|
|
|
## Python linting (`black`) is failing
|
|
|
|
|
|
|
|
To keep the code consistent with lots of contributors, we run automated code consistency checks.
|
|
|
|
To fix this CI test, please run:
|
|
|
|
|
|
|
|
* Install [`black`](https://black.readthedocs.io/en/stable/): `pip install black`
|
|
|
|
* Fix formatting errors in your pipeline: `black .`
|
|
|
|
|
|
|
|
Once you push these changes the test should pass, and you can hide this comment :+1:
|
|
|
|
|
|
|
|
We highly recommend setting up Black in your code editor so that this formatting is done automatically on save. Ask about it on Slack for help!
|
|
|
|
|
|
|
|
Thanks again for your contribution!
|
|
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
allow-repeats: false
|
|
|
|
|
2022-02-18 06:55:14 +00:00
|
|
|
nf-core:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Check out pipeline code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Install Nextflow
|
2022-08-30 13:43:03 +00:00
|
|
|
uses: nf-core/setup-nextflow@v1
|
2022-02-18 06:55:14 +00:00
|
|
|
|
2022-05-16 10:22:38 +00:00
|
|
|
- uses: actions/setup-python@v3
|
2022-02-18 06:55:14 +00:00
|
|
|
with:
|
2022-08-30 13:43:03 +00:00
|
|
|
python-version: "3.7"
|
2022-03-23 13:57:56 +00:00
|
|
|
architecture: "x64"
|
2022-02-18 06:55:14 +00:00
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
python -m pip install --upgrade pip
|
|
|
|
pip install nf-core
|
|
|
|
|
|
|
|
- name: Run nf-core lint
|
|
|
|
env:
|
|
|
|
GITHUB_COMMENTS_URL: ${{ github.event.pull_request.comments_url }}
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
GITHUB_PR_COMMIT: ${{ github.event.pull_request.head.sha }}
|
|
|
|
run: nf-core -l lint_log.txt lint --dir ${GITHUB_WORKSPACE} --markdown lint_results.md
|
|
|
|
|
|
|
|
- name: Save PR number
|
|
|
|
if: ${{ always() }}
|
|
|
|
run: echo ${{ github.event.pull_request.number }} > PR_number.txt
|
|
|
|
|
|
|
|
- name: Upload linting log file artifact
|
|
|
|
if: ${{ always() }}
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: linting-logs
|
|
|
|
path: |
|
|
|
|
lint_log.txt
|
|
|
|
lint_results.md
|
|
|
|
PR_number.txt
|