Skip to content

Commit

Permalink
Test against Pydantic 1 and 2 (#216)
Browse files Browse the repository at this point in the history
* Test against Pydantic 1 and 2

Adds Pydantic versions to the test matrix as folks are likely to be using both for a while.

* Quote version comparison

* Upload coverage from all test runs
  • Loading branch information
abkfenris authored Jul 20, 2023
1 parent 1c400d8 commit e9466e8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ on:

jobs:
test:
name: ${{ matrix.python-version }}-build
name: ${{ matrix.python-version }}-pydantic${{ matrix.pydantic-version }}-build
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
pydantic-version: ["<2", ">=2"]
steps:
- uses: actions/checkout@v3

Expand All @@ -26,8 +27,9 @@ jobs:
uses: actions/cache@v3.3.1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/dev-requirements.txt') }}
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-pydantic${{ matrix.pydantic-version }}-${{ hashFiles('**/dev-requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}-pydantic${{ matrix.pydantic-version }}
${{ runner.os }}-pip-${{ matrix.python-version }}
${{ runner.os }}-pip
${{ runner.os }}-pip-dev
Expand All @@ -36,6 +38,7 @@ jobs:
run: |
python -m pip install -r dev-requirements.txt
python -m pip install --no-deps -e .
python -m pip install "pydantic${{ matrix.pydantic-version }}"
python -m pip list
- name: Running Tests
Expand All @@ -44,7 +47,6 @@ jobs:
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3.1.4
if: ${{ matrix.python-version }} == 3.9
with:
file: ./coverage.xml
fail_ci_if_error: false
Expand Down

0 comments on commit e9466e8

Please sign in to comment.