Skip to content

Add testing support for postgres #192

Add testing support for postgres

Add testing support for postgres #192

Workflow file for this run

name: "CI"
on:
pull_request:
push:
branches:
- main
schedule:
- cron: "0 7 * * *"
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
defaults:
run:
shell: bash -l {0}
jobs:
tests:
runs-on: ${{ matrix.OS }}-latest
name: "tests"
strategy:
fail-fast: false
matrix:
os: ['ubuntu']
sql-backend: ["sqlite"]
python-version:
- "3.9"
- "3.10"
- "3.11"
include:
- python-version: "3.11"
sql-backend: "postgres"
steps:
- uses: actions/checkout@v3
# we use mamba for installing postgres; otherwise we're pip to ensure
# compatiblity
- uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
python-version: ${{ matrix.python-version }}
- run: python -m pip install -e .
name: "Install"
- name: "Install database"
run: ./devtools/${{ sql-backend }}/install.sh

Check failure on line 47 in .github/workflows/ci.yaml

View workflow run for this annotation

GitHub Actions / CI

Invalid workflow file

The workflow is not valid. .github/workflows/ci.yaml (Line: 47, Col: 14): Unrecognized named-value: 'sql-backend'. Located at position 1 within expression: sql-backend .github/workflows/ci.yaml (Line: 49, Col: 14): Unrecognized named-value: 'sql-backend'. Located at position 1 within expression: sql-backend
- name: "Create and start database"
run: ./devtools/${{ sql-backend }}/create.sh
- run: python -m pip install pytest pytest-cov
name: "Install testing tools"
- run: pytest -v --cov=exorcist --cov-report=xml
env:
EXORCIST_TEST_DB: ${{ matrix.sql-version }}
name: "Run tests"
- name: codecov
if: ${{ github.repository == 'OpenFreeEnergy/exorcist'
&& github.event_name != 'schedule' }}
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.xml
verbose: true