This repository has been archived by the owner on Nov 29, 2023. It is now read-only.
tests #202
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: tests | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
type: [ "opened", "reopened", "synchronize" ] | |
schedule: | |
- cron: '0 12 * * 0' # run once a week on Sunday | |
# Allow to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
tests: | |
strategy: | |
matrix: | |
config: | |
# [Python version, tox env] | |
- ["3.6", "py36"] | |
- ["3.7", "py37"] | |
- ["3.8", "py38"] | |
- ["3.9", "py39"] | |
- ["3.10", "py310"] | |
- ["3.8", "coverage"] | |
runs-on: ubuntu-20.04 | |
name: ${{ matrix.config[1] }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.config[0] }} | |
- name: Pip cache | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('setup.*', 'tox.ini') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install tox | |
- name: Test | |
run: tox -e ${{ matrix.config[1] }} | |
- name: Coverage | |
if: matrix.config[1] == 'coverage' | |
run: | | |
pip install coveralls coverage-python-version | |
coveralls --service=github | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |