feat: Ensure Python 3.13 support (#415) #974
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
defaults: | |
run: | |
shell: "bash" | |
name: "CI" | |
on: | |
push: | |
branches: ["main"] | |
tags: ["v*"] | |
pull_request: | |
branches: ["main"] | |
concurrency: | |
group: "${{ github.workflow }}-${{ github.head_ref || github.run_id }}" | |
cancel-in-progress: true | |
env: | |
PYTHONUNBUFFERED: "1" | |
jobs: | |
dev: | |
name: "Verify package is installed well" | |
strategy: | |
matrix: | |
os: ["ubuntu-latest", "macos-latest"] | |
runs-on: "${{ matrix.os }}" | |
steps: | |
- uses: "actions/[email protected]" | |
- id: "python_and_poetry" | |
uses: "./.github/actions/install_python_and_poetry" | |
with: | |
cache-key-suffix: "-main" | |
python-version-file: ".python-version" | |
- name: "Install package" | |
run: "poetry install --only main" | |
- name: "Check that the poetry.lock file corresponds to the current version of pyproject.toml" | |
if: "${{ matrix.os == 'ubuntu-latest' }}" | |
run: "poetry lock --check" | |
- name: "Import package" | |
run: "poetry run python3 -c 'import rororo; from rororo import aio, timedelta;'" | |
docs: | |
uses: "./.github/workflows/ci_verify_docs_build.yml" | |
test: | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13.0-rc.1"] | |
include: | |
- cache-key-suffix: "-main-dev" | |
- python-version: "3.12" | |
cache-key-suffix: "-main-dev-test" | |
dev: "true" | |
name: "Python ${{ matrix.python-version }}" | |
runs-on: "ubuntu-latest" | |
services: | |
redis: | |
image: "redis:6.0.7-alpine" | |
ports: | |
- "6379/tcp" | |
options: "--entrypoint redis-server" | |
steps: | |
- uses: "actions/[email protected]" | |
- name: "Install system packages" | |
run: "sudo apt-get update -yqq && sudo apt-get install -yq locales-all" | |
- id: "python_and_poetry" | |
uses: "./.github/actions/install_python_and_poetry" | |
with: | |
cache-key-suffix: "${{ matrix.cache-key-suffix }}" | |
python-version: "${{ matrix.python-version }}" | |
- if: "${{ matrix.dev == 'true' }}" | |
uses: "./.github/actions/run_pre_commit" | |
with: | |
python-version: "${{ steps.python_and_poetry.outputs.python-version }}" | |
- name: "Validate OpenAPI schemas" | |
if: "${{ matrix.dev == 'true' }}" | |
run: | | |
set -euo pipefail | |
poetry run python3 -m openapi_spec_validator examples/hobotnica/src/hobotnica/openapi.yaml | |
poetry run python3 -m openapi_spec_validator examples/petstore/src/petstore/petstore-expanded.yaml | |
poetry run python3 -m openapi_spec_validator examples/simulations/src/simulations/openapi.yaml | |
poetry run python3 -m openapi_spec_validator examples/todobackend/src/todobackend/openapi.yaml | |
poetry run python3 -m openapi_spec_validator tests/rororo/openapi.json | |
poetry run python3 -m openapi_spec_validator tests/rororo/openapi.yaml | |
- uses: "./.github/actions/run_tox" | |
env: | |
LEVEL: "test" | |
PYTHONPATH: "examples/hobotnica/src:examples/petstore/src:examples/simulations/src:examples/todobackend/src:examples/vc-api/src" | |
REDIS_URL: "redis://localhost:${{ job.services.redis.ports[6379] }}/0" | |
with: | |
python-path: "${{ steps.python_and_poetry.outputs.python-path }}" | |
python-version: "${{ steps.python_and_poetry.outputs.python-version }}" | |
use-coveralls: "${{ matrix.dev }}" | |
coveralls-token: "${{ secrets.GITHUB_TOKEN }}" | |
package: | |
needs: ["test"] | |
permissions: | |
id-token: "write" | |
uses: "./.github/workflows/ci_package.yml" | |
release: | |
needs: ["package"] | |
if: "${{ startsWith(github.ref, 'refs/tags/') }}" | |
uses: "./.github/workflows/ci_release.yml" | |
secrets: | |
release-token: "${{ secrets.GITHUB_TOKEN }}" |