Fail CI if test_changes errors #124
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: Tests | |
on: | |
- pull_request | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [ '3.11', '3.12'] | |
fail-fast: false | |
name: Tests with Python ${{ matrix.python-version }} | |
services: | |
postgres: | |
image: postgis/postgis:13-3.1-alpine | |
env: | |
POSTGRES_DB: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_USER: postgres | |
ports: | |
- 5432:5432 | |
# Set health checks to wait until postgres has started | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup python | |
uses: actions/setup-python@v1 | |
with: | |
python-version: ${{ matrix.python-version }} | |
architecture: x64 | |
- run: sudo apt-get install libxml2-dev libxslt1-dev | |
- run: pip install -r requirements.txt | |
- run: createdb jedeschule_test | |
env: | |
PGHOST: localhost | |
PGPASSWORD: postgres | |
PGPORT: 5432 | |
PGUSER: postgres | |
- run: | | |
set -e | |
alembic upgrade head | |
python test_models.py | |
env: | |
DATABASE_URL: postgresql://postgres:[email protected]:5432/jedeschule_test |