Skip to content

Feature/gra 900 server side api capabilities #1287

Feature/gra 900 server side api capabilities

Feature/gra 900 server side api capabilities #1287

name: Postgres Integration CI
on:
pull_request:
paths:
- "grai-integrations/source-postgres/**"
- "grai-client/**"
- "grai-server/**"
concurrency:
group: ${{ github.ref }}-postgres-ci
cancel-in-progress: true
env:
py_ver: "3.10"
poetry_ver: "1.2.2"
project_dir: "grai-integrations/source-postgres"
jobs:
lint-integration-postgres:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ env.project_dir }}
steps:
- name: Check out Git repository
uses: actions/checkout@v3
- name: Install Python
id: setup-python
uses: actions/setup-python@v4
with:
python-version: "${{ env.py_ver }}"
- run: pip install black isort
- run: |
black . --check
isort . --profile black --check
tests-integration-postgres:
needs: lint-integration-postgres
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ env.project_dir }}
services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: grai
POSTGRES_PASSWORD: grai
POSTGRES_DB: grai
ports:
- 5433:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 2s --health-timeout 5s --health-retries 15
steps:
- uses: actions/checkout@v3
- name: Set up Postgres db
working-directory: ${{ env.project_dir }}/dev-database
env:
POSTGRES_USER: grai
POSTGRES_PASSWORD: grai
POSTGRES_DB: grai
PORT: 5433
HOST: postgres
run: |
bash init-db.sh
- uses: actions/setup-python@v4
with:
python-version: "${{ env.py_ver }}"
- run: |
pip install pytest
pip install .
- run: pytest