Merge pull request #7 from minrk/pre-commit-ci-update-config #34
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
# This is a GitHub workflow defining a set of jobs with a set of steps. | |
# ref: https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions | |
# | |
name: Tests | |
on: | |
pull_request: | |
push: | |
workflow_dispatch: | |
jobs: | |
# Run tests | |
test: | |
runs-on: ubuntu-20.04 | |
timeout-minutes: 10 | |
strategy: | |
# Keep running even if one variation of the job fail | |
fail-fast: false | |
matrix: | |
python: | |
- "3.6" | |
- "3.7" | |
- "3.8" | |
- "3.9" | |
- "3.10" | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install Python ${{ matrix.python }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python }} | |
# preserve pip cache to speed up installation | |
- name: Cache pip | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cache/pip | |
# Look to see if there is a cache hit for the corresponding requirements file | |
key: ${{ runner.os }}-pip-${{ hashFiles('*requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install Python dependencies | |
run: | | |
pip install --upgrade pip | |
pip install --upgrade .[test] -r dev-requirements.txt | |
pip freeze | |
- name: Run tests | |
# FIXME: --color=yes explicitly set because: | |
# https://github.com/actions/runner/issues/241 | |
run: | | |
pytest -v --color=yes --cov=asyncio_atexit | |
- name: Submit codecov report | |
run: | | |
codecov |