-
Notifications
You must be signed in to change notification settings - Fork 438
CI tests via GitHub actions and conda #504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
murrayrm
merged 10 commits into
python-control:master
from
murrayrm:github-actions-conda
Jan 12, 2021
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
3f87c33
Create python-package-conda.yml
murrayrm 21e47a6
remove flake8 lint; add dependencies
murrayrm d83e67d
skip X11 tests if no DISPLAY env variable
murrayrm 627754f
expand test matrix to match Travis CI
murrayrm 47251c6
simplify GitHub actions workflow
murrayrm 6ff2e9b
pytest with slycot from source
murrayrm 5bb9de4
update xvfb configuration; remove X11 marks
murrayrm 36ecea1
update xvfb configuration; remove X11 marks
murrayrm b7b696f
add coveralls
murrayrm 40aac67
Merge branch 'github-actions-conda_revised' into github-actions-conda
murrayrm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
[run] | ||
source = control | ||
omit = control/tests/* | ||
relative_files = True | ||
|
||
[report] | ||
exclude_lines = | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Slycot from source | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build-linux: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
- name: Install Python dependencies | ||
run: | | ||
# Set up conda | ||
echo $CONDA/bin >> $GITHUB_PATH | ||
|
||
# Set up (virtual) X11 | ||
sudo apt install -y xvfb | ||
|
||
# Install test tools | ||
conda install pip pytest | ||
|
||
# Install python-control dependencies | ||
conda install numpy matplotlib scipy | ||
|
||
- name: Install slycot from source | ||
run: | | ||
# Install compilers, libraries, and development environment | ||
sudo apt-get -y install gfortran cmake --fix-missing | ||
sudo apt-get -y install libblas-dev liblapack-dev | ||
conda install -c conda-forge scikit-build; | ||
|
||
# Compile and install slycot | ||
git clone https://github.com/python-control/Slycot.git slycot | ||
cd slycot; python setup.py build_ext install -DBLA_VENDOR=Generic | ||
|
||
- name: Test with pytest | ||
run: xvfb-run --auto-servernum pytest control/tests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Conda-based pytest | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
test-linux: | ||
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. pytest-cov produces one. See python-control/Slycot#140. Use the --cov parameter. |
||
# 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 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
coveralls is on conda-forge nowadays