Fix testing to properly support rc releases #24
This file contains 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
name: Validate Python Code | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- develop | |
- main | |
jobs: | |
test-mac-linux: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
python-version: ["3.7", "3.8", "3.9"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install OS dependencies | |
run: | | |
case "${{ runner.os }}" in | |
Linux) | |
sudo apt-get update -yy | |
sudo apt-get install -yy \ | |
ccache \ | |
inkscape \ | |
ghostscript | |
if [[ "${{ matrix.os }}" = ubuntu-20.04 ]]; then | |
sudo apt install -yy libopengl0 | |
fi | |
;; | |
macOS) | |
;; | |
esac | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install flake8 pytest | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: Lint with flake8 | |
run: | | |
flake8 matplotview --count --select=E9,F63,F7,F82 --show-source --statistics | |
flake8 matplotview --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
- name: Test with pytest | |
run: | | |
pytest | |
test-windows: | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
python-version: [ "3.7", "3.8", "3.9" ] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pytest | |
pip install -r requirements.txt | |
- name: Test with pytest | |
run: | | |
pytest |