.github/workflows/test.yml
name: Test
on:
- push
jobs:
test:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
include:
- python-version: '2.7'
tox-env: py27
- python-version: '3.7'
tox-env: py37
- python-version: '3.8'
tox-env: py38
- python-version: '3.9'
tox-env: py39
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install cc-test-reporter
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
- run: pip install coverage tox
- run: ./cc-test-reporter before-build
- run: tox -e ${{ matrix.tox-env }}
- name: Format coverage
run: |
coverage combine
coverage xml
./cc-test-reporter format-coverage --input-type coverage.py --output 'coverage.${{ matrix.python-version }}.xml'
- uses: actions/upload-artifact@v2
with:
name: coverages
path: coverage.${{ matrix.python-version }}.xml
upload-coverage:
runs-on: ubuntu-20.04
needs: test
steps:
- uses: actions/download-artifact@v2
with:
name: coverages
- name: Install cc-test-reporter
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
- name: Upload coverage
run: ./cc-test-reporter sum-coverage --output - coverage.*.xml | ./cc-test-reporter upload-coverage --debug --input -
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
lint:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.9'
- run: pip install tox
- run: tox -e flake8