Files
starter-workflows/ci/python-package.yml
T

41 lines
1.3 KiB
YAML
Raw Normal View History

2020-02-20 13:59:00 -05:00
# 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
2019-07-29 09:38:23 -07:00
name: Python package
2020-02-12 13:26:01 -05:00
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
2020-02-20 13:59:00 -05:00
2019-08-06 16:37:30 -07:00
jobs:
2019-07-29 09:38:23 -07:00
build:
2019-08-06 16:37:30 -07:00
2019-07-29 09:38:23 -07:00
runs-on: ubuntu-latest
strategy:
matrix:
2020-01-18 20:34:03 -05:00
python-version: [3.5, 3.6, 3.7, 3.8]
2019-07-29 09:38:23 -07:00
2019-08-06 16:37:30 -07:00
steps:
2019-12-24 14:22:22 -08:00
- uses: actions/checkout@v2
2019-07-29 09:38:23 -07:00
- name: Set up Python ${{ matrix.python-version }}
2019-08-02 10:30:20 -04:00
uses: actions/setup-python@v1
2019-07-29 09:38:23 -07:00
with:
2019-08-14 14:05:28 -04:00
python-version: ${{ matrix.python-version }}
2019-07-29 09:38:23 -07:00
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Lint with flake8
run: |
pip install flake8
# 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
2019-07-29 09:38:23 -07:00
- name: Test with pytest
run: |
pip install pytest
pytest