Skip to content

CI

CI #318

Workflow file for this run

name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
schedule:
- cron: "9 16 * * 1"
jobs:
test:
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.9", "3.11", "3.12"]
pydantic-version: ["1", "2"]
runs-on: [ubuntu-latest, windows-latest]
exclude:
- runs-on: windows-latest
pydantic-version: "1"
name: "🐍 ${{ matrix.python-version }} • ${{ matrix.pydantic-version }} • ${{ matrix.runs-on }}"
runs-on: ${{ matrix.runs-on }}
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
# Force pydantic 1.0 by modifying poetry dep "pydantic" string with in-place sed
# -i is zero-length extension which does effectively in-place sub.
# Can't do -i '' because Ubuntu sed is -i{suffix} whereas OSX sed is -i {suffix}... ugh
# ^ start of line, pydantic, optional spaces and > sign, capture the version, replace with ^{version}
# Should avoid also replacing the autodoc-pydantic spec later on.
- name: Sed replace pydantic on repo
if: matrix.pydantic-version == '1'
run: |
sed -i 's/^pydantic *= *">*= *\([0-9.]*\)"/pydantic = "^\1"/' pyproject.toml
- name: Install repo with poetry (full deps)
if: matrix.python-version != '3.9'
run: poetry install --no-interaction --no-ansi --all-extras
- name: Install repo with poetry (min deps)
if: matrix.python-version == '3.9'
run: poetry install --no-interaction --no-ansi --extras test
- 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' )
if: false
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.10"
- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@v2
- name: Install poetry
run: pip install poetry
# Force pydantic 1.0 by modifying poetry dep "pydantic" string with in-place sed (see above for details)
- name: Sed replace pydantic on repo
run: |
sed -i 's/^pydantic *= *">*= *\([0-9.]*\)"/pydantic = "^\1"/' pyproject.toml
- 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/