2022-03-23 20:56:16 +00:00
|
|
|
name: Test
|
2022-10-23 12:38:52 +00:00
|
|
|
|
|
|
|
"on":
|
2020-12-20 15:40:40 +00:00
|
|
|
schedule:
|
2022-10-29 23:34:13 +00:00
|
|
|
# Every Friday at noon
|
|
|
|
- cron: "0 12 * * 5"
|
2020-12-20 15:40:40 +00:00
|
|
|
push:
|
|
|
|
branches:
|
2021-03-29 18:01:14 +00:00
|
|
|
- main
|
2022-01-06 02:14:02 +00:00
|
|
|
- dev
|
2022-02-02 20:54:27 +00:00
|
|
|
- deps
|
2020-12-20 15:40:40 +00:00
|
|
|
pull_request:
|
|
|
|
branches:
|
2021-03-29 18:01:14 +00:00
|
|
|
- main
|
2022-10-29 23:34:13 +00:00
|
|
|
|
2020-12-20 15:40:40 +00:00
|
|
|
jobs:
|
2022-10-29 23:34:13 +00:00
|
|
|
_:
|
2022-06-02 02:04:36 +00:00
|
|
|
name: ${{ matrix.pyversion }}
|
2022-10-23 12:38:52 +00:00
|
|
|
runs-on: ubuntu-latest
|
2020-12-20 15:40:40 +00:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
include:
|
2022-10-23 12:38:52 +00:00
|
|
|
# https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#available-versions-of-python-and-pypy
|
2022-10-29 23:34:13 +00:00
|
|
|
- pyversion: "3.11"
|
2022-10-23 12:38:52 +00:00
|
|
|
enable_coverage: true
|
2022-10-29 23:34:13 +00:00
|
|
|
- pyversion: "3.10"
|
|
|
|
- pyversion: "3.9"
|
|
|
|
- pyversion: "3.8"
|
|
|
|
- pyversion: "3.7"
|
2022-10-23 12:38:52 +00:00
|
|
|
enable_coverage: true
|
|
|
|
- pyversion: pypy-3.9
|
|
|
|
- pyversion: pypy-3.8
|
|
|
|
- pyversion: pypy-3.7
|
2020-12-20 15:40:40 +00:00
|
|
|
steps:
|
2022-10-29 23:34:13 +00:00
|
|
|
- uses: actions/checkout@v3.1.0
|
|
|
|
- uses: actions/setup-python@v4.3.0
|
2020-12-20 15:40:40 +00:00
|
|
|
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
|
2022-10-23 12:38:52 +00:00
|
|
|
- run: python -m pip install -U pip setuptools wheel tox
|
2021-12-24 19:06:47 +00:00
|
|
|
- name: cache .hypothesis dir
|
2022-10-29 23:34:13 +00:00
|
|
|
uses: actions/cache@v3.0.11
|
2020-12-20 15:40:40 +00:00
|
|
|
with:
|
|
|
|
path: .hypothesis
|
2022-06-02 02:04:36 +00:00
|
|
|
key: hypothesis|${{ runner.os }}|${{ matrix.pyversion }}
|
2022-10-23 12:38:52 +00:00
|
|
|
- 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
|
2022-10-29 23:34:13 +00:00
|
|
|
uses: codecov/codecov-action@v3.1.1
|
2022-10-23 12:38:52 +00:00
|
|
|
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
|