@@ -4,7 +4,12 @@ on: [push, pull_request]
4
4
5
5
jobs :
6
6
test-linux :
7
- name : Python ${{ matrix.python-version }}${{ matrix.slycot && format(' with Slycot from {0}', matrix.slycot) || ' without Slycot' }}${{ matrix.pandas && ', with pandas' || '' }}${{ matrix.array-and-matrix == 1 && ', array and matrix' || '' }}${{ matrix.cvxopt && format(' with cvxopt from {0}', matrix.cvxopt) || ' without cvxopt' }}
7
+ name : >
8
+ Py${{ matrix.python-version }};
9
+ ${{ matrix.slycot || 'no' }} Slycot;
10
+ ${{ matrix.pandas || 'no' }} Pandas;
11
+ ${{ matrix.cvxopt || 'no' }} CVXOPT;
12
+ ${{ matrix.array-and-matrix == 1 && '; array and matrix' || '' }}
8
13
runs-on : ubuntu-latest
9
14
10
15
strategy :
@@ -22,43 +27,43 @@ jobs:
22
27
array-and-matrix : 1
23
28
24
29
steps :
25
- - uses : actions/checkout@v2
30
+ - uses : actions/checkout@v3
26
31
27
- - name : Install dependencies
28
- run : |
29
- # Set up conda
30
- echo $CONDA/bin >> $GITHUB_PATH
31
- conda create -q -n test-environment python=${{matrix.python-version}}
32
- source $CONDA/bin/activate test-environment
33
-
34
- # Set up (virtual) X11
35
- sudo apt install -y xvfb
32
+ - name : Set up (virtual) X11
33
+ run : sudo apt install -y xvfb
36
34
37
- # Install test tools
38
- conda install pip coverage pytest pytest-timeout
39
- pip install coveralls
35
+ - name : Setup Conda
36
+ uses : conda-incubator/setup-miniconda@v2
37
+ with :
38
+ python-version : ${{ matrix.python-version }}
39
+ activate-environment : test-env
40
+ environment-file : .github/conda-env/test-env.yml
41
+ miniforge-version : latest
42
+ miniforge-variant : Mambaforge
43
+ channels : conda-forge
44
+ channel-priority : strict
45
+ auto-update-conda : false
46
+ auto-activate-base : false
40
47
41
- # Install python-control dependencies
42
- conda install numpy matplotlib scipy
48
+ - name : Install optional dependencies
49
+ shell : bash -l {0}
50
+ run : |
43
51
if [[ '${{matrix.slycot}}' == 'conda' ]]; then
44
- conda install -c conda-forge slycot
52
+ mamba install slycot
45
53
fi
46
54
if [[ '${{matrix.pandas}}' == 'conda' ]]; then
47
- conda install pandas
55
+ mamba install pandas
48
56
fi
49
57
if [[ '${{matrix.cvxopt}}' == 'conda' ]]; then
50
- conda install -c conda-forge cvxopt
58
+ mamba install cvxopt
51
59
fi
52
60
53
61
- name : Test with pytest
62
+ shell : bash -l {0}
54
63
env :
55
64
PYTHON_CONTROL_ARRAY_AND_MATRIX : ${{ matrix.array-and-matrix }}
56
65
run : |
57
- source $CONDA/bin/activate test-environment
58
- # Use xvfb-run instead of pytest-xvfb to get proper mpl backend
59
- # Use coverage instead of pytest-cov to get .coverage file
60
- # See https://github.com/python-control/python-control/pull/504
61
- xvfb-run --auto-servernum coverage run -m pytest control/tests
66
+ xvfb-run --auto-servernum pytest --cov=control --cov-config=.coveragerc control/tests
62
67
63
68
- name : Coveralls parallel
64
69
# https://github.com/coverallsapp/github-action
0 commit comments