Merge pull request #757 from bnavigator/conda-forge · python-control/python-control@a73a03d
@@ -4,7 +4,12 @@ on: [push, pull_request]
4455jobs:
66test-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' || '' }}
813 runs-on: ubuntu-latest
9141015strategy:
@@ -22,43 +27,43 @@ jobs:
2227array-and-matrix: 1
23282429steps:
25- - uses: actions/checkout@v2
30+ - uses: actions/checkout@v3
263127- - 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
363437- # 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
404741- # Install python-control dependencies
42- conda install numpy matplotlib scipy
48+ - name: Install optional dependencies
49+shell: bash -l {0}
50+run: |
4351 if [[ '${{matrix.slycot}}' == 'conda' ]]; then
44- conda install -c conda-forge slycot
52+ mamba install slycot
4553 fi
4654 if [[ '${{matrix.pandas}}' == 'conda' ]]; then
47- conda install pandas
55+ mamba install pandas
4856 fi
4957 if [[ '${{matrix.cvxopt}}' == 'conda' ]]; then
50- conda install -c conda-forge cvxopt
58+ mamba install cvxopt
5159 fi
52605361 - name: Test with pytest
62+shell: bash -l {0}
5463env:
5564PYTHON_CONTROL_ARRAY_AND_MATRIX: ${{ matrix.array-and-matrix }}
5665run: |
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
62676368 - name: Coveralls parallel
6469# https://github.com/coverallsapp/github-action