-
Notifications
You must be signed in to change notification settings - Fork 19
101 lines (101 loc) · 3.27 KB
/
main.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
---
# configuration for GitHub Actions
name: polytope tests
on:
push:
pull_request:
schedule:
# the start of every hour is
# a high-load time for GitHub Actions
# <https://docs.github.com/en/actions/reference/
# events-that-trigger-workflows>
- cron: '34 5 5 * *'
jobs:
build:
name: Build
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: [
'3.8',
'3.9',
'3.10',
'3.11',
]
steps:
- uses: actions/checkout@v3
- name: Install APT packages
run: |
sudo apt update
sudo apt install \
gfortran \
libatlas-base-dev \
liblapack-dev \
libgmp-dev \
libmpfr-dev \
libglpk-dev
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies from PyPI
run: |
pip install \
--ignore-installed \
--upgrade \
pip \
setuptools \
wheel
pip install \
--upgrade \
--only-binary=numpy,scipy \
numpy scipy
- name: Create sdist for `polytope`
run: |
python setup.py sdist
- name: Install from sdist of `polytope`
run: |
pip install dist/polytope-*.tar.gz
- name: Install test dependencies
run: |
pip install pytest
- name: Run tests, using required dependencies
run: |
set -o posix
echo 'Exported environment variables:'
export -p
cd tests/
pytest \
-v \
--continue-on-collection-errors \
.
- name: Install dependencies for plotting tests
run: |
pip install matplotlib
# the import statement ensures
# that no tests will be skipped below
python -c 'import matplotlib'
- name: Run all tests
run: |
set -o posix
echo 'Exported environment variables:'
export -p
pytest \
-v \
--continue-on-collection-errors \
.
- name: Install `cvxopt.glpk`
run: |
export CVXOPT_BUILD_GLPK=1
pip install cvxopt
python -c 'import cvxopt.glpk'
- name: Run all tests, using `cvxopt.glpk`
run: |
set -o posix
echo 'Exported environment variables:'
export -p
cd tests/
pytest \
-v \
--continue-on-collection-errors \
.