Skip to content

Update for new flask/flask-sqlalchemy #124

Update for new flask/flask-sqlalchemy

Update for new flask/flask-sqlalchemy #124

Workflow file for this run

name: test
on:
push:
branches:
- master
pull_request:
jobs:
test-matrix:
runs-on: ${{ matrix.os }}
services:
postgres:
image: postgres:14.9
env:
POSTGRES_PASSWORD: "password"
POSTGRES_INITDB_ARGS: --no-sync
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
strategy:
matrix:
os: [ubuntu-latest]
python-version: ['3.8', '3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Cache virtualenv
uses: actions/cache@v1
id: cache-pip
with:
path: venv
key: venv-${{ hashFiles('setup.py') }}-${{ hashFiles('requirements.txt') }}-${{ matrix.python-version }}-${{ matrix.os }}
- name: Install dependencies in a venv
if: steps.cache-pip.outputs.cache-hit != 'true'
run: |
python -m venv venv
. venv/bin/activate
pip install -q -U pip
pip install --progress-bar=off .
pip install --progress-bar=off -r requirements.txt
- name: Run all tests
env:
SQLALCHEMY_DATABASE_URI: postgresql://postgres:password@postgres:5432/chrononaut_test
run: |
. venv/bin/activate
py.test tests/