Skip to content

Improve test suite, utilities #2271

Improve test suite, utilities

Improve test suite, utilities #2271

Workflow file for this run

name: Test
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule: # 05:00 UTC = 06:00 CET = 07:00 CEST
- cron: "0 5 * * *"
# Cancel previous runs that have not completed
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
pytest:
strategy:
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest
python-version:
- "3.9" # Earliest supported version
- "3.10"
- "3.11"
- "3.12"
- "3.13" # Latest supported version
# commented: only enable once next Python version enters RC
# - "3.14.0-rc.1" # Development version
fail-fast: false
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }}-py${{ matrix.python-version }}
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
cache-dependency-glob: "**/pyproject.toml"
python-version: ${{ matrix.python-version }}
- name: Install Python, the package, and dependencies
run: uv pip install .[tests]
- name: Run pytest
run: |
uv run --no-sync \
pytest \
-ra --color=yes --verbose \
--sdmx-fetch-data \
--cov-report=xml \
--numprocesses auto
shell: bash
- name: Upload test coverage to Codecov.io
uses: codecov/codecov-action@v5
with: { token: "${{ secrets.CODECOV_TOKEN }}" }
pre-commit:
name: Code quality
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
cache-dependency-glob: "**/pyproject.toml"
# TEMPORARY Use Python 3.12 to avoid https://github.com/python/mypy/issues/18216
python-version: "3.12"
- uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: ${{ github.job }}|${{ hashFiles('.pre-commit-config.yaml') }}
lookup-only: ${{ github.event_name == 'schedule' }}
# lookup-only: true
- name: Run pre-commit
run: uvx pre-commit run --all-files --show-diff-on-failure --color=always