pytest-bdd/.github/workflows/main.yml

87 lines
2.5 KiB
YAML
Raw Normal View History

name: Main testing workflow
on:
push:
pull_request:
workflow_dispatch:
jobs:
2023-01-03 18:29:42 +08:00
test-run:
runs-on: ubuntu-latest
strategy:
matrix:
2023-01-03 18:29:42 +08:00
include:
- python-version: "3.8"
toxfactor: py38
ignore-typecheck-outcome: true
ignore-test-outcome: false
- python-version: "3.9"
toxfactor: py39
ignore-typecheck-outcome: true
ignore-test-outcome: false
- python-version: "3.10"
toxfactor: py310
ignore-typecheck-outcome: true
ignore-test-outcome: false
- python-version: "3.11"
toxfactor: py311
ignore-typecheck-outcome: true
ignore-test-outcome: false
2023-07-23 18:46:49 +08:00
- python-version: "3.12-dev"
2023-01-03 18:29:42 +08:00
toxfactor: py312
ignore-typecheck-outcome: true
2023-07-23 19:07:30 +08:00
ignore-test-outcome: false
steps:
2022-11-05 17:24:30 +08:00
- uses: actions/checkout@v3
2023-01-03 18:29:42 +08:00
- name: Set up Python ${{ matrix.python-version }}
2022-11-05 17:24:30 +08:00
uses: actions/setup-python@v4
2023-01-03 18:29:42 +08:00
id: setup-python
with:
python-version: ${{ matrix.python-version }}
2023-01-03 18:29:42 +08:00
- name: Install poetry
run: |
2023-07-23 18:56:01 +08:00
python -m pip install poetry==1.5.1
2023-01-03 18:29:42 +08:00
- name: Configure poetry
run: |
python -m poetry config virtualenvs.in-project true
- name: Cache the virtualenv
id: poetry-dependencies-cache
uses: actions/cache@v3
with:
path: ./.venv
key: ${{ runner.os }}-venv-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dev dependencies
if: steps.poetry-dependencies-cache.outputs.cache-hit != 'true'
run: |
2023-01-03 18:29:42 +08:00
python -m poetry install --only=dev
2022-02-24 23:52:23 +08:00
- name: Type checking
2023-01-03 18:29:42 +08:00
# Ignore errors for older pythons
continue-on-error: ${{ matrix.ignore-typecheck-outcome }}
2022-02-24 23:52:23 +08:00
run: |
2023-01-03 18:29:42 +08:00
source .venv/bin/activate
2022-02-24 23:52:23 +08:00
tox -e mypy
2023-01-03 18:29:42 +08:00
- name: Test with tox
2023-01-03 18:29:42 +08:00
continue-on-error: ${{ matrix.ignore-test-outcome }}
run: |
2023-01-03 18:29:42 +08:00
source .venv/bin/activate
coverage erase
2023-01-03 18:29:42 +08:00
tox run-parallel -f ${{ matrix.toxfactor }} --parallel-no-spinner --parallel-live
coverage combine
coverage xml
2023-01-03 18:29:42 +08:00
- uses: codecov/codecov-action@v3
with:
# Explicitly using the token in order to avoid Codecov rate limit errors
# See https://community.codecov.com/t/upload-issues-unable-to-locate-build-via-github-actions-api/3954
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
verbose: true # optional (default = false)