Add Github Actions build.

This commit is contained in:
Yuxin Wang 2019-10-21 22:46:24 -04:00 committed by GitHub
parent 67025c1c0b
commit 73cc073632

38
.github/workflows/main.yml vendored Normal file
View file

@ -0,0 +1,38 @@
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//.}"