-
Notifications
You must be signed in to change notification settings - Fork 18
99 lines (96 loc) · 2.87 KB
/
unit-tests.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
name: "Unit tests"
on:
pull_request:
branches:
- master
- stable
push:
branches:
- master
tags:
- "v*"
schedule:
- cron: "20 5 * * *"
defaults:
run:
shell: bash -l {0}
jobs:
test_suite:
runs-on: ${{ matrix.OS }}-latest
name: "Unit Tests"
strategy:
matrix:
CONDA_PY:
- "3.12"
- "3.11"
- "3.10"
OS: ["ubuntu"]
MDTRAJ: ["mdtraj-release"]
INSTALL_WITH: ["pip"]
include:
- CONDA_PY: "3.12"
OS: "ubuntu"
MDTRAJ: "mdtraj-dev"
INSTALL_WITH: "pip"
- CONDA_PY: "3.12"
OS: "windows"
MDTRAJ: "mdtraj-release"
INSTALL_WITH: "conda"
- CONDA_PY: "3.10"
OS: "windows"
MDTRAJ: "mdtraj-release"
INSTALL_WITH: "conda"
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
- uses: actions/setup-python@v2
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.CONDA_PY }}
- name: "Create requirements files"
run: python ci/extract_requirements.py
- name: "Install dependencies"
env:
INSTALL_WITH: ${{ matrix.INSTALL_WITH }}
run: |
# this trick only works as long as PyPI & conda-forge use same
# package names
if [ "$INSTALL_WITH" = "pip" ]; then
source ci/pip-pre-install.sh
INSTALLER_FLAGS="-U -r"
elif [ "$INSTALL_WITH" = "conda" ]; then
INSTALLER_FLAGS="-c conda-forge --file"
else
echo "Bad value for INSTALL_WITH: $INSTALL_WITH"
exit 1
fi
$INSTALL_WITH install $INSTALLER_FLAGS requirements.txt
# have to pip-install testing until autorelease on conda
pip install -U -r extras_test.txt
- name: "Install MDTraj development version (pip)"
if: ${{ matrix.MDTRAJ == 'mdtraj-dev' }}
run: pip install --upgrade --force-reinstall -r ci/mdtraj_dev.txt
- name: "Install optional extras (pip)"
# we only use this with pip, but in principle it could be converted
# to something that also uses conda
if: ${{ matrix.MDTRAJ == 'mdtraj-dev' }}
run: pip install -r extras_all.txt
- name: "Install contact_map"
run: pip install -e .
- name: "Versions"
env:
INSTALL_WITH: ${{ matrix.INSTALL_WITH }}
run: |
$INSTALL_WITH list
- name: "Autorelease check"
run: python autorelease_check.py
- name: "Tests"
env:
PY_COLORS: "1"
run: |
python -c "import contact_map"
py.test -vv --cov=contact_map --cov-report xml
- uses: codecov/codecov-action@v2
if: ${{ github.event != 'schedule' }}