Skip to content

Commit 47251c6

Browse files
committed
simplify GitHub actions workflow
1 parent 627754f commit 47251c6

File tree

1 file changed

+15
-21
lines changed

1 file changed

+15
-21
lines changed

.github/workflows/python-package-conda.yml

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
strategy:
1010
max-parallel: 5
1111
matrix:
12-
python-version: [2.7, 3.6, 3.9]
12+
python-version: [3.6, 3.9]
1313
slycot: ["", "conda"]
1414
array-and-matrix: [0]
1515
include:
@@ -19,34 +19,28 @@ jobs:
1919

2020
steps:
2121
- uses: actions/checkout@v2
22-
- name: Set up Python
23-
uses: actions/setup-python@v2
24-
- name: Set up conda
22+
- name: Install dependencies
2523
run: |
24+
# Set up conda
2625
echo $CONDA/bin >> $GITHUB_PATH
2726
conda create -q -n test-environment python=${{matrix.python-version}}
28-
- name: Install dependencies
29-
run: |
3027
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
3237
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
3640
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
4241
- name: Test with pytest
4342
env:
4443
PYTHON_CONTROL_ARRAY_AND_MATRIX: ${{ matrix.array-and-matrix }}
4544
run: |
4645
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

0 commit comments

Comments
 (0)