Move contrib CI into tox #56
Workflow file for this run
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 / Contrib / Tests | |
| on: | |
| push: | |
| paths: | |
| - openapi_core/** | |
| - tests/integration/contrib/** | |
| - tests/unit/contrib/** | |
| - tests/integration/conftest.py | |
| - tests/integration/data/** | |
| - pyproject.toml | |
| - poetry.lock | |
| - tox.ini | |
| - .github/workflows/contrib-tests.yml | |
| pull_request: | |
| types: [opened, synchronize] | |
| paths: | |
| - openapi_core/** | |
| - tests/integration/contrib/** | |
| - tests/unit/contrib/** | |
| - tests/integration/conftest.py | |
| - tests/integration/data/** | |
| - pyproject.toml | |
| - poetry.lock | |
| - tox.ini | |
| - .github/workflows/contrib-tests.yml | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| id-token: write | |
| jobs: | |
| contrib_matrix: | |
| name: "${{ matrix.target.label }} / py${{ matrix.python-version }}" | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| target: | |
| - contrib: aiohttp | |
| integration_path: tests/integration/contrib/aiohttp | |
| unit_path: tests/unit/contrib/aiohttp | |
| spec: ">=3.8,<4.0" | |
| label: "aiohttp-3.x" | |
| - contrib: aiohttp | |
| integration_path: tests/integration/contrib/aiohttp | |
| unit_path: tests/unit/contrib/aiohttp | |
| spec: ">=3.11,<4.0" | |
| label: "aiohttp-3.11+" | |
| - contrib: django | |
| integration_path: tests/integration/contrib/django | |
| unit_path: tests/unit/contrib/django | |
| spec: ">=4.0,<5.0" | |
| label: "django-4.x" | |
| - contrib: django | |
| integration_path: tests/integration/contrib/django | |
| unit_path: tests/unit/contrib/django | |
| spec: ">=5.0,<6.0" | |
| label: "django-5.x" | |
| - contrib: django | |
| integration_path: tests/integration/contrib/django | |
| unit_path: tests/unit/contrib/django | |
| spec: ">=6.0,<7.0" | |
| label: "django-6.x" | |
| - contrib: falcon | |
| integration_path: tests/integration/contrib/falcon | |
| spec: ">=4.0,<5.0" | |
| label: "falcon-4.x" | |
| - contrib: fastapi | |
| integration_path: tests/integration/contrib/fastapi | |
| spec: ">=0.111,<0.120" | |
| label: "fastapi-0.11x" | |
| - contrib: fastapi | |
| integration_path: tests/integration/contrib/fastapi | |
| spec: ">=0.120,<0.129" | |
| label: "fastapi-0.12x" | |
| - contrib: flask | |
| integration_path: tests/integration/contrib/flask | |
| unit_path: tests/unit/contrib/flask | |
| spec: ">=2.0,<3.0" | |
| label: "flask-2.x" | |
| - contrib: flask | |
| integration_path: tests/integration/contrib/flask | |
| unit_path: tests/unit/contrib/flask | |
| spec: ">=3.0,<4.0" | |
| label: "flask-3.x" | |
| - contrib: requests | |
| integration_path: tests/integration/contrib/requests | |
| unit_path: tests/unit/contrib/requests | |
| spec: "" | |
| label: "requests-default" | |
| - contrib: starlette | |
| integration_path: tests/integration/contrib/starlette | |
| spec: ">=0.40.0,<0.50.0" | |
| label: "starlette-0.4x" | |
| - contrib: starlette | |
| integration_path: tests/integration/contrib/starlette | |
| spec: ">=0.50.0,<0.60.0" | |
| label: "starlette-0.5x" | |
| - contrib: werkzeug | |
| integration_path: tests/integration/contrib/werkzeug | |
| spec: "" | |
| label: "werkzeug-default" | |
| python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] | |
| exclude: | |
| - target: | |
| label: "django-6.x" | |
| python-version: "3.10" | |
| - target: | |
| label: "django-6.x" | |
| python-version: "3.11" | |
| fail-fast: false | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Get full Python version | |
| id: full-python-version | |
| run: python -c "import sys; print(f\"version={'-'.join(str(v) for v in sys.version_info)}\")" >> "$GITHUB_OUTPUT" | |
| - name: Set up poetry | |
| uses: Gr1N/setup-poetry@v9 | |
| with: | |
| poetry-version: "2.3.1" | |
| - name: Set up cache | |
| uses: actions/cache@v5 | |
| id: cache | |
| with: | |
| path: | | |
| ~/.cache/pypoetry | |
| ~/.cache/pip | |
| key: deps-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ matrix.target.label }}-${{ hashFiles('**/poetry.lock', 'tox.ini') }} | |
| restore-keys: | | |
| deps-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ matrix.target.label }}- | |
| deps-${{ runner.os }}-${{ matrix.python-version }}- | |
| - name: Install tox | |
| run: python -m pip install tox | |
| - name: Build tox test paths | |
| shell: bash | |
| run: | | |
| paths=("${{ matrix.target.integration_path }}") | |
| unit_path="${{ matrix.target.unit_path }}" | |
| if [ -d "$unit_path" ]; then | |
| paths+=("$unit_path") | |
| fi | |
| printf "CONTRIB_PATHS=%s\n" "${paths[*]}" >> "$GITHUB_ENV" | |
| - name: Test | |
| env: | |
| CONTRIB_PACKAGE: ${{ matrix.target.contrib }} | |
| CONTRIB_SPEC: ${{ matrix.target.spec }} | |
| run: tox -e contrib | |
| - name: Upload coverage | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| flags: contrib,${{ matrix.target.contrib }},${{ matrix.target.label }},py${{ matrix.python-version }} | |
| name: contrib-${{ matrix.target.contrib }}-${{ matrix.target.label }}-py${{ matrix.python-version }} |