| 1 |
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions |
| 2 |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions |
| 3 |
|
| 4 |
name: build |
| 5 |
|
| 6 |
on: |
| 7 |
push: |
| 8 |
branches: [ master ] |
| 9 |
pull_request: |
| 10 |
branches: [ master ] |
| 11 |
|
| 12 |
jobs: |
| 13 |
build: |
| 14 |
name: ${{ matrix.os }} Python ${{ matrix.python-version }} |
| 15 |
runs-on: ${{ matrix.os }} |
| 16 |
strategy: |
| 17 |
matrix: |
| 18 |
os: [ubuntu-latest, windows-latest, macOS-latest] |
| 19 |
python-version: ['3.7', '3.8'] |
| 20 |
|
| 21 |
steps: |
| 22 |
- uses: actions/checkout@v2 |
| 23 |
|
| 24 |
- name: Set up Python ${{ matrix.os }} ${{ matrix.python-version }} |
| 25 |
uses: actions/setup-python@v2 |
| 26 |
with: |
| 27 |
python-version: ${{ matrix.python-version }} |
| 28 |
|
| 29 |
- name: Install dependencies |
| 30 |
run: | |
| 31 |
python -m pip install --upgrade pip |
| 32 |
python -m pip install flake8 pytest |
| 33 |
python -m pip install wheel |
| 34 |
python -m pip install numpy>=1.20.0 |
| 35 |
pip install -r dev-requirements.txt |
| 36 |
python setup.py install |
| 37 |
|
| 38 |
- name: Lint with flake8 |
| 39 |
run: | |
| 40 |
# stop the build if there are Python syntax errors or undefined names |
| 41 |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics |
| 42 |
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide |
| 43 |
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics |
| 44 |
|
| 45 |
- name: Test with pytest |
| 46 |
run: python setup.py test |