forked from test_framework/pytest-bdd
87 lines
2.5 KiB
YAML
87 lines
2.5 KiB
YAML
name: Main testing workflow
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
test-run:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- python-version: "3.8"
|
|
toxfactor: py3.8
|
|
ignore-typecheck-outcome: true
|
|
ignore-test-outcome: false
|
|
- python-version: "3.9"
|
|
toxfactor: py3.9
|
|
ignore-typecheck-outcome: true
|
|
ignore-test-outcome: false
|
|
- python-version: "3.10"
|
|
toxfactor: py3.10
|
|
ignore-typecheck-outcome: true
|
|
ignore-test-outcome: false
|
|
- python-version: "3.11"
|
|
toxfactor: py3.11
|
|
ignore-typecheck-outcome: true
|
|
ignore-test-outcome: false
|
|
- python-version: "3.12-dev"
|
|
toxfactor: py3.12
|
|
ignore-typecheck-outcome: true
|
|
ignore-test-outcome: false
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v4
|
|
id: setup-python
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Install poetry
|
|
run: |
|
|
python -m pip install poetry==1.5.1
|
|
|
|
- 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: |
|
|
python -m poetry install --only=dev
|
|
|
|
- name: Type checking
|
|
# Ignore errors for older pythons
|
|
continue-on-error: ${{ matrix.ignore-typecheck-outcome }}
|
|
run: |
|
|
source .venv/bin/activate
|
|
tox -e mypy
|
|
|
|
- name: Test with tox
|
|
continue-on-error: ${{ matrix.ignore-test-outcome }}
|
|
run: |
|
|
source .venv/bin/activate
|
|
coverage erase
|
|
tox run-parallel -f ${{ matrix.toxfactor }} --parallel-no-spinner --parallel-live
|
|
coverage combine
|
|
coverage xml
|
|
|
|
- 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)
|