2020-12-25 20:36:41 +00:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2020-12-25 20:57:27 +00:00
|
|
|
- main
|
2020-12-25 20:36:41 +00:00
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
tests:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
2020-12-25 20:40:56 +00:00
|
|
|
python-version: [3.7, 3.8, 3.9]
|
2020-12-25 20:36:41 +00:00
|
|
|
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 nox
|
|
|
|
run: |
|
|
|
|
python -m pip install --upgrade pip
|
|
|
|
pip install nox
|
|
|
|
|
|
|
|
- name: Lint and typing
|
|
|
|
run: |
|
|
|
|
nox -rs lint typing
|
|
|
|
|
|
|
|
- name: Tests
|
|
|
|
run: |
|
|
|
|
nox -rs tests -- -v
|
|
|
|
|
|
|
|
build_publish:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
if: github.event_name == 'push'
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Set up Python 3.8
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: 3.8
|
|
|
|
|
|
|
|
- name: Install tools
|
|
|
|
run: |
|
|
|
|
python -m pip install --upgrade pip
|
|
|
|
pip install twine
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: |
|
|
|
|
python setup.py sdist bdist_wheel
|
|
|
|
|
|
|
|
- name: Publish
|
|
|
|
run: |
|
|
|
|
export TWINE_USERNAME=${{ secrets.TWINE_USERNAME }}
|
|
|
|
export TWINE_PASSWORD=${{ secrets.TWINE_PASSWORD }}
|
|
|
|
twine upload dist/*
|