-
Notifications
You must be signed in to change notification settings - Fork 29
131 lines (124 loc) · 3.89 KB
/
ci.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: CI
on:
push:
branches:
- main
pull_request:
jobs:
pylint:
name: Pylint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Use pip cache
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: pip-${{ hashFiles('**/requirements*.txt') }}
restore-keys: |
pip-
- name: Install dependencies
run: |
pip install wheel
pip install -r requirements.txt
pip install -r requirements-dev.txt
curl -sSL https://broad.io/install-gcs-connector | python3 - --auth-type UNAUTHENTICATED
- name: Check formatting
run: black --check gnomad tests
- name: Check imports
run: isort --check-only gnomad tests
- name: Check docstrings
run: pydocstyle gnomad tests
- name: Check comment formatting
run: autopep8 --exit-code --diff gnomad
- name: Run Pylint
run: ./lint
- name: Run tests
run: python -m pytest
docs:
name: Build documentation
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Use pip cache
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: pip-${{ hashFiles('**/requirements*.txt') }}
restore-keys: |
pip-
- name: Install dependencies
run: |
pip install wheel
pip install -r requirements.txt
pip install -r docs/requirements.docs.txt
- name: Build docs
run: ./docs/build.sh
- name: Publish to GitHub Pages
if: github.event_name == 'push'
run: |
# Create empty gh-pages branch
git checkout --orphan gh-pages
# Remove files other than docs
git rm -rf .
find . -name __pycache__ | xargs rm -r
# Move docs to root
mv docs/html/* ./
rm -r docs
# Tell GitHub not to treat this as a Jekyll site
touch .nojekyll
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git add .
git commit --allow-empty -m "Update docs"
git push --force origin gh-pages
# Restore the original working tree by checking out the
# commit that triggered the workflow.
# This restores requirements.txt so that @actions/cache
# can use it for determining the cache key.
git checkout ${GITHUB_SHA}
gnomad_qc:
name: gnomad_qc checks
runs-on: ubuntu-latest
steps:
- name: Checkout gnomad_methods
uses: actions/checkout@v3
with:
path: gnomad_methods
- name: Checkout gnomad_qc
uses: actions/checkout@v3
with:
submodules: recursive
repository: broadinstitute/gnomad_qc
path: gnomad_qc
- name: Setup Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Use pip cache
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: pip-${{ hashFiles('gnomad_methods/**/requirements*.txt') }}
restore-keys: |
pip-
- name: Install dependencies
run: |
pip install wheel
pip install ./gnomad_methods
cat gnomad_qc/requirements.txt | grep -v gnomad_methods > gnomad_qc/requirements-edited.txt
pip install -r gnomad_qc/requirements-edited.txt
pip install -r gnomad_methods/requirements-dev.txt
- name: Run Pylint
run: pylint --disable=R,C,W gnomad_qc
working-directory: ./gnomad_qc