From 269fad7c54fa781e36553576f9284b6eb90104ed Mon Sep 17 00:00:00 2001 From: Will Scullin Date: Thu, 14 Mar 2024 09:04:02 -0700 Subject: [PATCH] Postgres action (#1659) Postgres action --- .github/workflows/db-motherduck.yaml | 4 +-- .github/workflows/db-postgres.yaml | 48 ++++++++++++++++++++++++++++ .github/workflows/db-snowflake.yaml | 4 +-- cloudbuild/build-test/test.sh | 4 ++- 4 files changed, 55 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/db-postgres.yaml diff --git a/.github/workflows/db-motherduck.yaml b/.github/workflows/db-motherduck.yaml index ad03b737d..3f08c0e59 100644 --- a/.github/workflows/db-motherduck.yaml +++ b/.github/workflows/db-motherduck.yaml @@ -1,9 +1,9 @@ -name: MotherDuck +name: MotherDuck DB on: [push] jobs: - build: + test-motherduck: runs-on: ubuntu-latest strategy: diff --git a/.github/workflows/db-postgres.yaml b/.github/workflows/db-postgres.yaml new file mode 100644 index 000000000..0ee286e63 --- /dev/null +++ b/.github/workflows/db-postgres.yaml @@ -0,0 +1,48 @@ +name: Postgres DB + +on: [push] + +jobs: + # Label of the container job + test-postgres: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.x] + + services: + postgres: + image: postgres + env: + POSTGRES_USER: root + POSTGRES_PASSWORD: postgres + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - 5432:5432 + + steps: + - uses: actions/checkout@v4 + with: + submodules: 'true' + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + - name: npm install, build, and test + run: | + npm ci --loglevel error + npm run build + echo CREATE EXTENSION tsm_system_rows\; | psql + gunzip -c test/data/postgres/malloytest-postgres.sql.gz | psql + npm run test-silent + env: + MALLOY_DATABASES: postgres + PGHOST: localhost + PGPORT: 5432 + PGUSER: root + PGPASSWORD: postgres diff --git a/.github/workflows/db-snowflake.yaml b/.github/workflows/db-snowflake.yaml index 561d4df34..b92c46b89 100644 --- a/.github/workflows/db-snowflake.yaml +++ b/.github/workflows/db-snowflake.yaml @@ -1,9 +1,9 @@ -name: Snowflake DB (Non-blocking) +name: Snowflake DB on: [push] jobs: - build: + test-snowflake: runs-on: ubuntu-latest strategy: diff --git a/cloudbuild/build-test/test.sh b/cloudbuild/build-test/test.sh index ff7609533..5abedea48 100755 --- a/cloudbuild/build-test/test.sh +++ b/cloudbuild/build-test/test.sh @@ -10,10 +10,12 @@ nix-shell \ --command "$(cat <