Skip to content
Prev Previous commit
Next Next commit
simplify GitHub actions workflow
  • Loading branch information
murrayrm committed Jan 11, 2021
commit 47251c655276adbd898e01fb2660cdafeaaa9d58
36 changes: 15 additions & 21 deletions .github/workflows/python-package-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
max-parallel: 5
matrix:
python-version: [2.7, 3.6, 3.9]
python-version: [3.6, 3.9]
slycot: ["", "conda"]
array-and-matrix: [0]
include:
Expand All @@ -19,34 +19,28 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
- name: Set up conda
- name: Install dependencies
run: |
# Set up conda
echo $CONDA/bin >> $GITHUB_PATH
conda create -q -n test-environment python=${{matrix.python-version}}
- name: Install dependencies
run: |
source $CONDA/bin/activate test-environment
conda install pip coverage pytest

# Set up (virtual) X11
sudo apt install -y xvfb

# Install test tools
conda install pip coverage pytest
conda install -c conda-forge pytest-xvfb pytest-cov

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

coverage not reported to coveralls yet

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to merge the PR before this is run and (hopefully) at that point things start to show up in coveralls?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

coverage != coveralls.

See https://coveralls-python.readthedocs.io/en/latest/usage/configuration.html#github-actions-gotcha and my previously linked workflow draft for Slycot. (Much more complicated than yours! :( )


# Install python-control dependencies
conda install numpy matplotlib scipy
if [[ '${{matrix.python-version}}' == '2.7' ]]; then
# matplotlib for Python 2.7 seems to require X11 to run correctly
sudo apt install -y xvfb
if [[ '${{matrix.slycot}}' == 'conda' ]]; then
conda install -c conda-forge slycot
fi
- name: Install slycot via conda (optional)
if: ${{ matrix.slycot == 'conda' }}
run: |
source $CONDA/bin/activate test-environment
conda install -c conda-forge slycot
- name: Test with pytest
env:
PYTHON_CONTROL_ARRAY_AND_MATRIX: ${{ matrix.array-and-matrix }}
run: |
source $CONDA/bin/activate test-environment
if [[ '${{matrix.python-version}}' == '2.7' ]]; then
# Run within (virtual) X11 environment for Python 2.7/matplotlib
xvfb-run pytest control/tests
else
coverage run -m pytest control/tests
fi
xvfb-run --auto-servernum pytest control/tests
Comment thread
murrayrm marked this conversation as resolved.
Outdated