Update for new flask/flask-sqlalchemy #129
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: test | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
jobs: | |
test-matrix: | |
runs-on: ${{ matrix.os }} | |
services: | |
postgres: | |
image: postgres:14.9 | |
env: | |
POSTGRES_PASSWORD: "password" | |
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', '3.12'] | |
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@localhost:5432/chrononaut_test | |
run: | | |
. venv/bin/activate | |
py.test tests/ |