|
9 | 9 | strategy: |
10 | 10 | max-parallel: 5 |
11 | 11 | matrix: |
12 | | - python-version: [2.7, 3.6, 3.9] |
| 12 | + python-version: [3.6, 3.9] |
13 | 13 | slycot: ["", "conda"] |
14 | 14 | array-and-matrix: [0] |
15 | 15 | include: |
@@ -19,34 +19,28 @@ jobs: |
19 | 19 |
|
20 | 20 | steps: |
21 | 21 | - uses: actions/checkout@v2 |
22 | | - - name: Set up Python |
23 | | - uses: actions/setup-python@v2 |
24 | | - - name: Set up conda |
| 22 | + - name: Install dependencies |
25 | 23 | run: | |
| 24 | + # Set up conda |
26 | 25 | echo $CONDA/bin >> $GITHUB_PATH |
27 | 26 | conda create -q -n test-environment python=${{matrix.python-version}} |
28 | | - - name: Install dependencies |
29 | | - run: | |
30 | 27 | source $CONDA/bin/activate test-environment |
31 | | - conda install pip coverage pytest |
| 28 | +
|
| 29 | + # Set up (virtual) X11 |
| 30 | + sudo apt install -y xvfb |
| 31 | +
|
| 32 | + # Install test tools |
| 33 | + conda install pip coverage pytest |
| 34 | + conda install -c conda-forge pytest-xvfb pytest-cov |
| 35 | +
|
| 36 | + # Install python-control dependencies |
32 | 37 | conda install numpy matplotlib scipy |
33 | | - if [[ '${{matrix.python-version}}' == '2.7' ]]; then |
34 | | - # matplotlib for Python 2.7 seems to require X11 to run correctly |
35 | | - sudo apt install -y xvfb |
| 38 | + if [[ '${{matrix.slycot}}' == 'conda' ]]; then |
| 39 | + conda install -c conda-forge slycot |
36 | 40 | fi |
37 | | - - name: Install slycot via conda (optional) |
38 | | - if: ${{ matrix.slycot == 'conda' }} |
39 | | - run: | |
40 | | - source $CONDA/bin/activate test-environment |
41 | | - conda install -c conda-forge slycot |
42 | 41 | - name: Test with pytest |
43 | 42 | env: |
44 | 43 | PYTHON_CONTROL_ARRAY_AND_MATRIX: ${{ matrix.array-and-matrix }} |
45 | 44 | run: | |
46 | 45 | source $CONDA/bin/activate test-environment |
47 | | - if [[ '${{matrix.python-version}}' == '2.7' ]]; then |
48 | | - # Run within (virtual) X11 environment for Python 2.7/matplotlib |
49 | | - xvfb-run pytest control/tests |
50 | | - else |
51 | | - coverage run -m pytest control/tests |
52 | | - fi |
| 46 | + xvfb-run --auto-servernum pytest control/tests |