17 #28
This file contains hidden or 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 • Pytest | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| paths: | |
| - "**.py" | |
| - "requirements/**" | |
| - "pytest.ini" | |
| - ".github/workflows/ci-tests.yml" | |
| pull_request: | |
| branches: [ main, master ] | |
| paths: | |
| - "**.py" | |
| - "requirements/**" | |
| - "pytest.ini" | |
| - ".github/workflows/ci-tests.yml" | |
| workflow_dispatch: | |
| jobs: | |
| tests: | |
| name: Python ${{ matrix.python-version }} • ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| python-version: ["3.12", "3.13"] | |
| env: | |
| PYTHONUTF8: "1" | |
| PIP_DISABLE_PIP_VERSION_CHECK: "1" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: pip | |
| cache-dependency-path: | | |
| requirements/requirements.build.txt | |
| requirements/requirements.test.txt | |
| requirements/constraints.ci.txt | |
| - name: Install deps | |
| run: | | |
| python -m pip install -U pip | |
| python -m pip install -r requirements/requirements.build.txt -c requirements/constraints.ci.txt | |
| python -m pip install -r requirements/requirements.test.txt -c requirements/constraints.ci.txt | |
| - name: Ensure pydantic-settings is present | |
| shell: bash | |
| run: | | |
| python - <<'PY' | |
| import importlib, sys, subprocess | |
| try: | |
| importlib.import_module("pydantic_settings") | |
| print("pydantic_settings is installed.") | |
| except ModuleNotFoundError: | |
| print("Installing pydantic-settings...") | |
| subprocess.check_call([sys.executable, "-m", "pip", "install", "pydantic-settings>=2.2"]) | |
| PY | |
| - name: Run unit tests | |
| run: | | |
| pytest -q --disable-warnings | |
| - name: Pip debug (on failure) | |
| if: failure() | |
| run: | | |
| pip debug --verbose || true | |
| pip check || true | |
| pip list || true |