forked from python-control/python-control
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (57 loc) · 2.03 KB
/
python-package-conda.yml
File metadata and controls
68 lines (57 loc) · 2.03 KB
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
name: Conda-based pytest
on: [push, pull_request]
jobs:
test-linux:
name: Python ${{ matrix.python-version }}${{ matrix.slycot && format(' with Slycot from {0}', matrix.slycot) || ' without Slycot' }}${{ matrix.array-and-matrix == 1 && ', array and matrix' || '' }}
runs-on: ubuntu-latest
strategy:
max-parallel: 5
matrix:
python-version: [3.6, 3.9]
slycot: ["", "conda"]
array-and-matrix: [0]
include:
- python-version: 3.9
slycot: conda
array-and-matrix: 1
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
# Set up conda
echo $CONDA/bin >> $GITHUB_PATH
conda create -q -n test-environment python=${{matrix.python-version}}
source $CONDA/bin/activate test-environment
# Set up (virtual) X11
sudo apt install -y xvfb
# Install test tools
conda install pip coverage pytest
pip install coveralls
# Install python-control dependencies
conda install numpy matplotlib scipy
if [[ '${{matrix.slycot}}' == 'conda' ]]; then
conda install -c conda-forge slycot
fi
- name: Test with pytest
env:
PYTHON_CONTROL_ARRAY_AND_MATRIX: ${{ matrix.array-and-matrix }}
run: |
source $CONDA/bin/activate test-environment
# Use xvfb-run instead of pytest-xvfb to get proper mpl backend
# Use coverage instead of pytest-cov to get .coverage file
# See https://github.com/python-control/python-control/pull/504
xvfb-run --auto-servernum coverage run -m pytest control/tests
- name: Coveralls parallel
# https://github.com/coverallsapp/github-action
uses: AndreMiras/coveralls-python-action@develop
with:
parallel: true
coveralls:
name: coveralls completion
needs: test-linux
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: AndreMiras/coveralls-python-action@develop
with:
parallel-finished: true