feat: add test for Python3.13 (#2219) #3045
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: Test | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
test: | |
name: Test on Python ${{ matrix.python-version }} and ${{ matrix.os }} and isort ${{ matrix.isort-version }} and pydantic ${{ matrix.pydantic-version }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
isort-version: [default] | |
black-version: [default] | |
pydantic-version: [1.10.9, 2.10.3] | |
include: | |
- os: ubuntu-latest | |
isort-version: 4.3.21 | |
black-version: default | |
python-version: 3.8 | |
pydantic-version: 1.5.1 | |
- os: ubuntu-latest | |
isort-version: 5.6.4 | |
black-version: default | |
python-version: 3.8 | |
pydantic-version: 1.8.2 | |
- os: ubuntu-latest | |
isort-version: 5.6.4 | |
black-version: 19.10b0 | |
python-version: 3.9 | |
pydantic-version: 1.8.2 | |
- os: ubuntu-latest | |
isort-version: 5.6.4 | |
black-version: 24.1.0 | |
python-version: 3.12 | |
pydantic-version: 2.4.2 | |
- os: ubuntu-latest | |
isort-version: 5.6.4 | |
black-version: 23.12.1 | |
python-version: 3.12 | |
pydantic-version: 2.4.2 | |
- os: ubuntu-latest | |
isort-version: 5.6.4 | |
black-version: 22.1.0 | |
python-version: 3.12 | |
pydantic-version: 2.4.2 | |
exclude: | |
- os: windows-latest | |
black-version: 22.1.0 | |
- os: macos-latest | |
black-version: 22.1.0 | |
- os: windows-latest | |
pydantic-version: 1.10.9 | |
- os: macos-latest | |
pydantic-version: 1.10.9 | |
- os: windows-latest | |
python-version: 3.8 | |
- os: macos-latest | |
python-version: 3.8 | |
- os: windows-latest | |
python-version: 3.9 | |
- os: macos-latest | |
python-version: 3.9 | |
- os: windows-latest | |
python-version: 3.10 | |
- os: macos-latest | |
python-version: 3.10 | |
- os: windows-latest | |
python-version: 3.11 | |
- os: macos-latest | |
python-version: 3.11 | |
- os: windows-latest | |
python-version: 3.12 | |
- os: macos-latest | |
python-version: 3.12 | |
- os: macos-latest | |
isort-version: 4.3.21 | |
- isort-version: 5.6.4 | |
pydantic-version: 1.10.9 | |
defaults: | |
run: | |
shell: bash | |
env: | |
OS: ${{ matrix.os }} | |
PYTHON: ${{ matrix.python-version }} | |
ISORT: ${{ matrix.isort-version }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
version: 1.7.1 | |
virtualenvs-path: .venv | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
installer-parallel: true | |
- name: Load cached venv | |
id: cached-poetry-dependencies | |
uses: actions/cache@v2 | |
if: matrix.os != 'windows-latest' | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pydantic-version }}-v1-${{ hashFiles('**/poetry.lock') }} | |
- name: Install dependencies | |
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
run: poetry install --no-interaction -E http -E graphql | |
- name: Install isort ${{ matrix.isort-version }} for Linux/macOS | |
if: "runner.os != 'Windows' && matrix.isort-version != 'default'" | |
run: | | |
poetry run pip install isort==${{ matrix.isort-version }} | |
- name: Install Pydantic ${{ matrix.pydantic-version }} | |
if: matrix.pydantic-version != 'default' | |
run: | | |
poetry run pip install pydantic=="${{ matrix.pydantic-version }}" | |
- name: Install Black ${{ matrix.black-version }} | |
if: matrix.black-version != 'default' | |
run: | | |
poetry run pip install black=="${{ matrix.black-version }}" | |
- name: Lint | |
if: matrix.pydantic-version == 'default' | |
run: | | |
source $VENV | |
./scripts/lint.sh | |
- name: Unit Test | |
run: | | |
source $VENV | |
./scripts/test.sh | |
- name: Upload coverage to Codecov | |
if: matrix.os == 'ubuntu-latest' && matrix.pydantic-version != '1.5.1' | |
uses: codecov/codecov-action@v5 | |
with: | |
flags: unittests | |
files: ./coverage.xml | |
fail_ci_if_error: true | |
env_vars: OS,PYTHON,ISORT | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |