From de47a330e56f1b6a98530be3ddf10152b29650da Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Thu, 2 May 2024 15:31:55 -0400 Subject: [PATCH] add postgres setup to integration tests --- .github/workflows/release_prep_hatch.yml | 33 ++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release_prep_hatch.yml b/.github/workflows/release_prep_hatch.yml index c556dda0..f4393e0a 100644 --- a/.github/workflows/release_prep_hatch.yml +++ b/.github/workflows/release_prep_hatch.yml @@ -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 }} @@ -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