From bdca07cb99b4769c5adc0b431a7e0a60ff1af3b2 Mon Sep 17 00:00:00 2001 From: Emily Rockman Date: Mon, 8 Jul 2024 21:18:14 -0500 Subject: [PATCH] remove bq, add postgres setup --- .github/workflows/ci.yml | 23 +++++++++++++++++++---- integration_tests/.env/bigquery.env | 2 +- supported_adapters.env | 2 +- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7de85e14..812bce6e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -89,10 +89,25 @@ jobs: - name: Start PostgreSQL if: matrix.adapter == 'postgres' run: | - sudo systemctl start postgresql.service - pg_isready - sudo -u postgres createuser -s -d -r -w ${{ vars.POSTGRES_USER }} - + # initdb requires file for password in non-interactive mode + export PWFILE="$RUNNER_TEMP/pwfile" + echo "postgres" > $PWFILE + initdb --pgdata="$PGDATA" --username="postgres" --pwfile="$PWFILE" + + echo "Starting PostgreSQL..." + echo "unix_socket_directories = '$PGHOST'" >> "$PGDATA/postgresql.conf" + pg_ctl start + + echo "Creating user..." + psql --host "$PGHOST" --username="postgres" --dbname="postgres" --command="CREATE USER $PGUSERNAME PASSWORD '$PGPASSWORD'" --command="\du" + + echo "Creating database..." + createdb --owner="$PGUSERNAME" --username="postgres" "$PGDATABASE" + env: + PGHOST: ${{ vars.POSTGRES_HOST }} + PGDATABASE: ${{ vars.POSTGRES_DATABASE }} + PGUSERNAME: ${{ vars.POSTGRES_USER }} + PGPASSWORD: ${{ secrets.POSTGRES_PASS }} - name: "Install ${{ matrix.adapter }}" run: | diff --git a/integration_tests/.env/bigquery.env b/integration_tests/.env/bigquery.env index 6cc1a9b4..932cd313 100644 --- a/integration_tests/.env/bigquery.env +++ b/integration_tests/.env/bigquery.env @@ -1,3 +1,3 @@ DBT_ENV_SECRET_BIGQUERY_KEYFILE_JSON= -BIGQUERY_PROJECTs= +BIGQUERY_PROJECT= BIGQUERY_SCHEMA=dbt_utils_integration_tests_bigquery \ No newline at end of file diff --git a/supported_adapters.env b/supported_adapters.env index 3acc8a8b..7e734380 100755 --- a/supported_adapters.env +++ b/supported_adapters.env @@ -1 +1 @@ -SUPPORTED_ADAPTERS=postgres,snowflake,redshift,bigquery +SUPPORTED_ADAPTERS=postgres,snowflake,redshift