CI: Switch to github actions #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: main | |
on: [push, pull_request] | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: [3.5, 3.6, 3.7, 3.8, pypy3] | |
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 dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pytest hypothesis flake8 coverage | |
- name: Run tests on Unix | |
if: ${{ matrix.os != 'windows-latest' }} | |
run: | | |
LANG=C LC_ALL=C python -c "import sys; print(sys.getfilesystemencoding())"; | |
LANG=C LC_ALL=C python -m coverage run --branch setup.py test | |
LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 python -c "import sys; print(sys.getfilesystemencoding())"; | |
LANG=C LC_ALL=C python -m coverage run --append --branch setup.py test | |
python -m coverage xml -i | |
- name: Run tests on Windows | |
if: ${{ matrix.os == 'windows-latest' }} | |
run: | | |
python -m coverage run --branch setup.py test | |
python -m coverage xml -i | |
- name: Run flake8 | |
run: | | |
python -m flake8 | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v1 | |
test-mypy: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: [3.6, 3.8] | |
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 dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install mypy | |
- name: Run mypy | |
run: | | |
python -m mypy . | |
test-py2: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: [2.7] | |
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 dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pytest hypothesis coverage typing | |
- name: Run tests on Unix | |
if: ${{ matrix.os != 'windows-latest' }} | |
run: | | |
LANG=C LC_ALL=C python -c "import sys; print(sys.getfilesystemencoding())"; | |
LANG=C LC_ALL=C python -m coverage run --branch setup.py test | |
LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 python -c "import sys; print(sys.getfilesystemencoding())"; | |
LANG=C LC_ALL=C python -m coverage run --append --branch setup.py test | |
python -m coverage xml -i | |
- name: Run tests on Windows | |
if: ${{ matrix.os == 'windows-latest' }} | |
run: | | |
python -m coverage run --branch setup.py test | |
python -m coverage xml -i | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v1 |