-
Notifications
You must be signed in to change notification settings - Fork 214
118 lines (103 loc) · 3.46 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
name: CI
on:
push:
branches:
- "master"
pull_request:
branches:
- "master"
- "base-ci-env-fix"
schedule:
# Run a cron job once weekly on Monday
- cron: "0 3 * * 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@v2
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.cfg.python-version }}
mamba-version: "*"
# Uncomment next line if you are running the tests locally via https://github.com/nektos/act
#miniconda-version: "latest"
activate-environment: teachopencadd
channel-priority: true
environment-file: devtools/test_env.yml
auto-activate-base: false
- 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"
# Ignore T019 under Windows, see https://github.com/volkamerlab/teachopencadd/issues/313
PYTEST_IGNORE_T019="--ignore=teachopencadd/talktorials/T019_md_simulation/talktorial.ipynb"
# Temporarily ignored notebooks, see https://github.com/volkamerlab/teachopencadd/issues/303
PYTEST_IGNORE_T008="--ignore=teachopencadd/talktorials/T008_query_pdb/talktorial.ipynb"
if [ "$RUNNER_OS" != "Windows" ]; then
# Temporarily ignore T019
pytest $PYTEST_ARGS teachopencadd/talktorials/ $PYTEST_IGNORE_T008 $PYTEST_IGNORE_T019
else
pytest $PYTEST_ARGS teachopencadd/talktorials/ $PYTEST_IGNORE_T008 $PYTEST_IGNORE_T019
fi
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 teachopencadd/talktorials/T*/talktorial.ipynb
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 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