-
Notifications
You must be signed in to change notification settings - Fork 186
76 lines (65 loc) · 2.07 KB
/
qc.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Code quality
on:
pull_request:
branches_ignore: []
jobs:
formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup mamba
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: fmt
channels: "conda-forge, bioconda"
miniforge-variant: Mambaforge
miniforge-version: latest
- name: Setup environment
shell: bash -el {0}
run: |
conda config --set channel_priority strict
mamba install -n fmt -y black snakefmt
- name: Check Python formatting
shell: bash -el {0}
run: |
black --check */*/*/wrapper.py */*/wrapper.py
# TODO reactivate once comment errors are fixed
# - name: Check Snakemake formatting
# run: |
# export PATH="/usr/share/miniconda/bin:$PATH"
# source activate fmt
# snakefmt --check $(git diff origin/master --name-only | grep Snakefile)
linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Setup mamba
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: snakemake
channels: "conda-forge, bioconda"
miniforge-variant: Mambaforge
miniforge-version: latest
- name: Setup Snakemake environment
shell: bash -el {0}
run: |
conda config --set channel_priority strict
mamba install -n snakemake -y snakemake-minimal snakemake
- name: Fetch master
run: |
git fetch origin master
- name: Linting
shell: bash -el {0}
run: |
declare -i ERRORS=0
# get all modified and added files, not those that are deleted
for f in $(git diff origin/master --name-only --diff-filter=d | grep Snakefile)
do
snakemake -s $f --lint
ERRORS+=$?
done
if (( $ERRORS > 0 ))
then
echo "There are some lints above. Please fix them."
exit 1
fi