Skip to content

Commit

Permalink
add postgres setup to integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mikealfare committed May 2, 2024
1 parent 35515ed commit de47a33
Showing 1 changed file with 31 additions and 2 deletions.
33 changes: 31 additions & 2 deletions .github/workflows/release_prep_hatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ jobs:

steps:
- name: "Checkout ${{ github.repository }}@${{ needs.release-branch.outputs.name }}"
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ needs.release-branch.outputs.name }}

Expand All @@ -353,17 +353,46 @@ jobs:
- generate-changelog
- bump-version

services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432

steps:
- name: "Checkout ${{ github.repository }}@${{ needs.release-branch.outputs.name }}"
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ needs.release-branch.outputs.name }}

- name: Setup postgres
run: psql -f ./scripts/setup_test_database.sql
env:
PGHOST: localhost
PGPORT: 5432
PGUSER: postgres
PGPASSWORD: postgres
PGDATABASE: postgres

- name: "Set up `hatch`"
uses: dbt-labs/dbt-adapters/.github/actions/setup-hatch@main

- name: "Run integration tests"
run: hatch run integration-tests:all
env:
POSTGRES_TEST_HOST: localhost
POSTGRES_TEST_PORT: 5432
POSTGRES_TEST_USER: root
POSTGRES_TEST_PASS: password
POSTGRES_TEST_DATABASE: dbt
POSTGRES_TEST_THREADS: 4

merge-release-branch:
runs-on: ubuntu-latest
Expand Down

0 comments on commit de47a33

Please sign in to comment.