diff --git a/.github/workflows/test_postgresql.yaml b/.github/workflows/test_postgresql.yaml new file mode 100644 index 00000000..14c3f785 --- /dev/null +++ b/.github/workflows/test_postgresql.yaml @@ -0,0 +1,58 @@ +name: Test PostgreSQL +on: + push: + +jobs: + + test: + + runs-on: ubuntu-latest + + env: + PGHOST: localhost + PGPORT: 5432 + PGUSER: rubin + PGPASSWORD: rubin + PGDATABASE: sdm_schemas_test + + services: + postgres: + image: postgres:13 + env: + POSTGRES_USER: rubin + POSTGRES_PASSWORD: rubin + POSTGRES_DB: sdm_schemas_test + ports: + - 5432:5432 + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + + steps: + + - name: Check out repo + uses: actions/checkout@v4 + + - name: Setup Python and install dependencies + uses: ./.github/actions/setup + + - name: Set engine URL + run: echo "FELIS_ENGINE_URL=postgresql+psycopg2://rubin:rubin@localhost:5432/sdm_schemas_test" >> $GITHUB_ENV + + - name: Create databases + run: ./scripts/create-databases.sh + + - name: Create SQL files + run: ./scripts/generate-sql-files.sh postgresql + + - name: Load SQL files + run: ./scripts/test-load-sql-postgres.sh + + - name: Initialize TAP_SCHEMA database + run: | + felis init-tap $FELIS_ENGINE_URL + + - name: Upload to TAP_SCHEMA database + run: ./scripts/test-load-tap-postgres.sh