Configure pytest to ignore known DeprecationWarning
s
#247
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [main, 3.x.x] | |
paths: | |
- "**.py" | |
- "**.toml" | |
- "**.lock" | |
pull_request: | |
branches: [main, 3.x.x] | |
types: [opened, synchronize] | |
paths: | |
- ".github/workflows/ci.yaml" # self | |
- "**.py" | |
- "**.toml" | |
- "**.lock" | |
- ".pre-commit-config.yaml" | |
jobs: | |
Tests: | |
strategy: | |
fail-fast: true | |
matrix: | |
include: | |
- os: ubuntu-latest | |
python-version: "3.10" | |
- os: ubuntu-latest | |
python-version: "3.11" | |
- os: ubuntu-latest | |
python-version: "3.12" | |
- os: ubuntu-latest | |
python-version: "3.13" | |
- os: windows-latest | |
python-version: "3.10" | |
- os: macos-latest | |
python-version: "3.10" | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/setup-python-uv | |
with: | |
python-version: ${{ matrix.python-version }} | |
- run: uv run coverage run --source=. --parallel-mode -m pytest tests | |
- name: Upload coverage results | |
uses: actions/upload-artifact@v4 | |
if: matrix.os == 'ubuntu-latest' # Cross-platform coverage combination doesn't work | |
with: | |
name: coverage-results-${{ matrix.python-version }} | |
path: coverage/ | |
Tutorial-tests: | |
runs-on: ubuntu-latest | |
name: Tutorial tests | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Install cadwyn with instructions from docs | |
run: sh docs_src/quickstart/setup/block001.sh | |
- run: pip install pytest coverage dirty-equals | |
- run: coverage run --source=. --parallel-mode -m pytest docs_src | |
- name: Upload coverage results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-results-docs | |
path: coverage/ | |
Coverage: | |
needs: [Tests, Tutorial-tests] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download coverage info | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: coverage-results-* | |
merge-multiple: true | |
path: coverage/ | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- run: pip install 'coverage[toml]' | |
- run: coverage combine | |
- run: coverage xml | |
- name: Upload to Codecov | |
uses: codecov/codecov-action@v4 | |
env: | |
fail_ci_if_error: true | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
- run: coverage report --fail-under=100 --show-missing | |
Lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pre-commit/action@v3.0.0 | |
Typecheck: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/setup-python-uv | |
- uses: jakebailey/pyright-action@v1 | |
with: | |
pylance-version: latest-release |