-
Notifications
You must be signed in to change notification settings - Fork 0
133 lines (115 loc) · 4.25 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
132
133
name: CI
on:
push:
branches:
- "master"
pull_request:
branches:
- "master"
- "dev"
schedule:
# every two weeks on Monday at 3 am
- cron: "0 3/336 * * 1"
jobs:
test:
name: Pytest
runs-on: ${{ matrix.cfg.os }}
strategy:
fail-fast: false
matrix:
cfg:
- os: ubuntu-latest
python-version: "3.8"
- os: ubuntu-latest
python-version: "3.9"
- os: macos-latest
python-version: "3.8"
- os: windows-latest
python-version: "3.8"
env:
PYVER: ${{ matrix.cfg.python-version }}
PACKAGE: teachopencadd
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.cfg.python-version }}
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: teachopencadd
environment-file: devtools/test_env.yml
- name: Additional info about the build
shell: bash
run: |
uname -a
df -h
ulimit -a
- name: Install package
shell: bash -l {0}
run: |
pip install . --no-deps -vv
- name: Environment Information
shell: bash -l {0}
run: |
conda info --all
conda list
- name: Test CLI
shell: bash -l {0}
run: |
teachopencadd -h
pytest -v --cov=${PACKAGE} --cov-report=xml --color=yes ${PACKAGE}/tests/
- name: Run tests
shell: bash -l {0}
run: |
PYTEST_ARGS="--nbval-lax --current-env --dist loadscope --numprocesses 2"
PYTEST_IGNORE_T001="--ignore=teachopencadd/talktorials/T001_query_chembl/talktorial.ipynb"
PYTEST_IGNORE_T018="--ignore=teachopencadd/talktorials/T018_automated_cadd_pipeline/talktorial.ipynb"
PYTEST_IGNORE_T019="--ignore=teachopencadd/talktorials/T019_md_simulation/talktorial.ipynb"
PYTEST_IGNORE_T020="--ignore=teachopencadd/talktorials/T020_md_analysis/talktorial.ipynb"
PYTEST_IGNORE_T035="--ignore=teachopencadd/talktorials/T035_graph_neural_networks/talktorial.ipynb"
PYTEST_IGNORE_T036="--ignore=teachopencadd/talktorials/T036_e3_equivariant_gnn/talktorial.ipynb"
PYTEST_IGNORE_T038="--ignore=teachopencadd/talktorials/T038_protein_ligand_interaction_prediction/talktorial.ipynb"
IGNORE="$PYTEST_IGNORE_T001"
if [ "$RUNNER_OS" == "Windows" ]; then
# Ignore T019 under Windows, see https://github.com/volkamerlab/teachopencadd/issues/313
IGNORE="$IGNORE $PYTEST_IGNORE_T019"
IGNORE="$IGNORE $PYTEST_IGNORE_T035"
IGNORE="$IGNORE $PYTEST_IGNORE_T036"
IGNORE="$IGNORE $PYTEST_IGNORE_T038"
fi
if [ "$RUNNER_OS" == "Linux" ]; then
IGNORE="$IGNORE $PYTEST_IGNORE_T018" # see 385
fi
if [ "$RUNNER_OS" == "macOS" ]; then
IGNORE="$IGNORE $PYTEST_IGNORE_T018" # see 385
IGNORE="$IGNORE $PYTEST_IGNORE_T019"
IGNORE="$IGNORE $PYTEST_IGNORE_T035" # may cause kernel dying in pytest
IGNORE="$IGNORE $PYTEST_IGNORE_T036" # may cause kernel dying in pytest
fi
pytest $PYTEST_ARGS teachopencadd/talktorials/ $IGNORE
format:
name: Black
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- name: Install format dependencies
run: python -m pip install black-nb shyaml
- name: Run black-nb
run: |
black-nb -l 99 --check teachopencadd/talktorials/T*/talktorial.ipynb
readmes:
name: READMEs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- name: Install nbformat
run: python -m pip install nbformat shyaml
- name: Check READMEs are up-to-date
run: |
for path in teachopencadd/talktorials/T*/talktorial.ipynb; 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