bidict/.github/workflows/test.yml

60 lines
1.8 KiB
YAML
Raw Normal View History

2022-03-23 20:56:16 +00:00
name: Test
"on":
schedule:
# Every Friday at noon
- cron: "0 12 * * 5"
push:
branches:
2021-03-29 18:01:14 +00:00
- main
- dev
2022-02-02 20:54:27 +00:00
- deps
pull_request:
branches:
2021-03-29 18:01:14 +00:00
- main
jobs:
_:
2022-06-02 02:04:36 +00:00
name: ${{ matrix.pyversion }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
# https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#available-versions-of-python-and-pypy
- pyversion: "3.11"
enable_coverage: true
- pyversion: "3.10"
- pyversion: "3.9"
- pyversion: "3.8"
- pyversion: "3.7"
enable_coverage: true
- pyversion: pypy-3.9
- pyversion: pypy-3.8
- pyversion: pypy-3.7
steps:
- uses: actions/checkout@v3.1.0
- uses: actions/setup-python@v4.3.0
with:
2022-06-02 02:04:36 +00:00
python-version: ${{ matrix.pyversion }}
2021-12-24 19:06:47 +00:00
cache: pip
2022-06-02 02:04:36 +00:00
cache-dependency-path: requirements/tests.txt
- run: python -m pip install -U pip setuptools wheel tox
2021-12-24 19:06:47 +00:00
- name: cache .hypothesis dir
uses: actions/cache@v3.0.11
with:
path: .hypothesis
2022-06-02 02:04:36 +00:00
key: hypothesis|${{ runner.os }}|${{ matrix.pyversion }}
- name: Configure pytest to enable coverage
if: matrix.enable_coverage
run: |
echo PYTEST_ADDOPTS="${PYTEST_ADDOPTS} --cov=bidict --cov-config=.coveragerc --cov-report=xml" >> $GITHUB_ENV
echo TOX_TESTENV_PASSENV=PYTEST_ADDOPTS >> $GITHUB_ENV
- run: tox -e py
- name: Upload coverage to Codecov # https://github.com/codecov/codecov-action
uses: codecov/codecov-action@v3.1.1
if: matrix.enable_coverage
2021-10-13 22:22:13 +00:00
with:
verbose: true
2022-03-23 20:56:16 +00:00
fail_ci_if_error: false # https://github.com/codecov/codecov-action/issues/557