-
Notifications
You must be signed in to change notification settings - Fork 3
103 lines (97 loc) · 2.74 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
name: CI
on:
push:
branches:
- "master"
pull_request:
branches:
- "master"
schedule:
# Run CI twice a month
- cron: "0 3 1,15 * *"
jobs:
test:
name: Pytest
runs-on: ${{ matrix.cfg.os }}
strategy:
fail-fast: false
matrix:
cfg:
- os: ubuntu-latest
python-version: "3.7"
- os: macos-latest
python-version: "3.7"
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.cfg.python-version }}
activate-environment: kissim
mamba-version: "*"
channel-priority: true
environment-file: devtools/test_env.yaml
auto-activate-base: false
- name: Additional info about the build
shell: bash
run: |
uname -a
df -h
ulimit -a
- name: Environment information
shell: bash -l {0}
run: |
conda info --all
conda list
- name: Install package
# conda setup requires this special shell
shell: bash -l {0}
run: |
pip install -e ../kissim_app
conda list
- name: Run tests
shell: bash -l {0}
run: |
PYTEST_ARGS="--nbval-lax --current-env --nbval-cell-timeout=900"
pytest $PYTEST_ARGS notebooks/ --ignore notebooks/002_structures/006_alphafold.ipynb --ignore=notebooks/007_kissim_setups
format:
name: Black
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Install format dependencies
run: python -m pip install black-nb shyaml
- name: Run black-nb
run: |
black-nb -l 99 --check notebooks
black -l 99 --check src
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Install lint dependencies
shell: bash
run: |
python -m pip install flake8-nb
- name: Run flake8-nb
shell: bash
run: |
flake8-nb --config tox.ini notebooks
flake8 --config tox.ini src
readmes:
name: READMEs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Install nbformat
run: python -m pip install nbformat shyaml
- name: Check READMEs are up-to-date
run: |
for path in notebooks/[^.]*/; do
python devtools/regenerate_readmes.py --output README.md $path
done
# If the script above introduced changes (it shouldn't!), git diff will have output and an error code
git diff --exit-code