38 lines
1.2 KiB
YAML
38 lines
1.2 KiB
YAML
name: build
|
|
|
|
on: [push]
|
|
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, macOS-latest, windows-latest]
|
|
python-version: [3.7]
|
|
runs-on: ${{ matrix.os }}
|
|
env:
|
|
# TODO: remove this when github actions support "if" in expressions
|
|
PYTHON_VERSION: ${{ matrix.python-version }}
|
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@master
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@master
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
- name: Update pip
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
- 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
|
|
- name: Test with tox
|
|
shell: bash
|
|
run: |
|
|
pip install tox
|
|
# remove the "." in the python version
|
|
tox -e "py${PYTHON_VERSION//.}"
|