-
Notifications
You must be signed in to change notification settings - Fork 26
97 lines (90 loc) · 2.73 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
name: CI
on:
push:
branches:
- main
pull_request:
jobs:
pylint:
name: Pylint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- 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
- name: Check formatting
run: black --check gnomad_qc
- name: Check imports
run: isort --check-only gnomad_qc
- name: Check comment formatting
run: autopep8 --exit-code --diff gnomad_qc
- name: Run Pylint
run: ./lint --disable=W
- name: Check docstrings
run: pydocstyle --match-dir='(?!v2|cuKING).*' gnomad_qc
docs:
name: Build documentation
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- 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}