Use Pydantic v1 API even with pydantic v2 #71
Workflow file for this run
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: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.7", "3.11"] | |
pydantic-version: ["1", "2"] | |
steps: | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Install poetry | |
run: pip install poetry | |
- name: Install repo with Pydantic v2 | |
run: poetry install --no-interaction --no-ansi | |
if: ${{ matrix.pydantic-version == 2 }} | |
- name: Install repo with Pydantic v1 | |
run: poetry install --no-interaction --no-ansi --without pydantic --with pydanticv1 | |
if: ${{ matrix.pydantic-version == 1 }} | |
- name: Run tests | |
run: poetry run pytest -rws -v --cov=qcelemental --color=yes --cov-report=xml | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 # NEEDS UPDATE TO v3 https://github.com/codecov/codecov-action | |
- name: QCSchema Examples Deploy | |
uses: JamesIves/github-pages-deploy-action@4.1.1 | |
if: github.event_name == 'push' && github.repository == 'MolSSI/QCElemental' && ( startsWith( github.ref, 'refs/tags/' ) || github.ref == 'refs/heads/master' ) | |
with: | |
branch: qcschema-examples | |
folder: qcelemental/tests/qcschema_instances | |
build_documentation: | |
needs: [test] | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
name: Set up Python | |
with: | |
python-version: "3.7" | |
- name: Install poetry | |
run: pip install poetry | |
- name: Install repo | |
run: poetry install --no-interaction --no-ansi | |
- name: Build Documentation | |
run: bash scripts/build_docs.sh | |
- name: GitHub Pages Deploy | |
uses: JamesIves/github-pages-deploy-action@4.1.1 | |
if: github.event_name == 'push' && github.repository == 'MolSSI/QCElemental' && ( startsWith( github.ref, 'refs/tags/' ) || github.ref == 'refs/heads/master' ) | |
with: | |
branch: gh-pages | |
folder: build/docs/ |