Skip to content

Update build-deploy.yml #219

Update build-deploy.yml

Update build-deploy.yml #219

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: test-lint
# formerly used branches: [ main ] for both push and PR
on:
push:
pull_request:
jobs:
linting:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, "3.10", "3.11"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
USE_CYTHON=False pip install .
pip install flake8
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
#flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=99 --statistics
# run test-suite on all python versions with newest dependencies, plus on oldest version with oldest dependencies
test-suite:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, "3.10"]
env: [
'--upgrade --upgrade-strategy=eager .[test]'
]
include:
- python-version: 3.8
env: '-r requirements-min.txt .[test]'
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install cython
pip install .
# pytest prefers to import from local dir instead of system PATH, so
# make local dir installable. Would be better to get it to import from
# system path...
python setup.py build_ext --inplace
pip install pytest
# if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install ${{ matrix.env }}
- name: Test with pytest
run: |
pytest tests