Skip to content

[pre-commit.ci] pre-commit autoupdate #257

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #257

Workflow file for this run

name: Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
inputs:
tests:
description: Run "pytest"
type: boolean
required: true
coverage:
description: └─ Upload "pytest" coverage
type: boolean
required: true
docs:
description: Run "mkdocs build"
type: boolean
required: true
jobs:
filter:
uses: ./.github/workflows/filter.yml
with:
filters: |
botstrap: ["botstrap/**"]
tests: ["tests/**"]
docs: ["docs/**"]
pytest:
needs: filter
if: |
contains(needs.filter.outputs.matches, 'botstrap') ||
contains(needs.filter.outputs.matches, 'tests')
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.10", "3.11"]
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- python-version: 3.12-dev
os: ubuntu-latest
fail-fast: false
steps:
- name: Check out repository
uses: actions/[email protected]
- name: Set up Python ${{ matrix.python-version }}
uses: actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: setup.py
- name: Install dependencies
run: python -m pip install -U pip tox
- name: Run tests and generate coverage report (via tox)
run: tox -e py -- --cov-report=xml
- name: Upload coverage to Codecov
if: |
matrix.os == 'ubuntu-latest' &&
matrix.python-version == '3.10' &&
(github.event_name != 'workflow_dispatch' || inputs.coverage)
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
verbose: true
mkdocs-build:
needs: filter
if: contains(needs.filter.outputs.matches, 'docs')
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/[email protected]
- name: Set up Python 3.10
uses: actions/[email protected]
with:
python-version: "3.10"
cache: pip
cache-dependency-path: docs/requirements.txt
- name: Install dependencies
run: python -m pip install -U pip tox
- name: Run "mkdocs build" via tox
run: tox -e docs