Fix github actions config #4
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: CI | |
on: | |
push: | |
branches: ["master"] | |
pull_request: | |
branches: ["master"] | |
jobs: | |
build: | |
name: "Python ${{ matrix.python-version }} ${{ matrix.pydantic-version }} ${{ matrix.os }} " | |
runs-on: "${{ matrix.os }}" | |
strategy: | |
matrix: | |
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] | |
os: [ubuntu-latest] | |
pydantic-version: ["pydantic-v1", "pydantic-v2"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip setuptools | |
pip install -r requirements-dev.txt | |
- name: Install Pydantic v1 | |
if: matrix.pydantic-version == 'pydantic-v1' | |
run: pip install "pydantic>=1.10.0,<2.0.0" | |
- name: Install Pydantic v2 | |
if: matrix.pydantic-version == 'pydantic-v2' | |
run: pip install "pydantic>=2.0.2,<3.0.0" | |
- name: Lint with flake8 | |
run: | | |
python -m flake8 pydantic_collections tests | |
continue-on-error: true | |
- name: Run tests | |
# run: python -m pytest tests --cov=./pydantic_collections --cov-report term-missing -s | |
run: python -m pytest tests --cov=./pydantic_collections --cov-report xml | |
- name: Upload coverage | |
uses: codecov/codecov-action@v3 | |
with: | |
file: ./coverage.xml | |
flags: unit | |
fail_ci_if_error: false |