From 473ab7e4a3eeaae38ef59a88eb98a015db0985b9 Mon Sep 17 00:00:00 2001 From: Jessy Barrette <30420025+JessyBarrette@users.noreply.github.com> Date: Fri, 3 Nov 2023 07:40:49 -0400 Subject: [PATCH] fix db views, table build test --- .github/workflows/test-erddap-views.yaml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-erddap-views.yaml b/.github/workflows/test-erddap-views.yaml index 97f14f96..13435320 100644 --- a/.github/workflows/test-erddap-views.yaml +++ b/.github/workflows/test-erddap-views.yaml @@ -3,13 +3,13 @@ on: push: paths: - views/** - branch: + branches: - development - master pull_request: paths: - views/** - branch: + branches: - development - master jobs: @@ -27,4 +27,12 @@ jobs: PGDATABASE: ${secrets.PGDATABASE} PGUSER: ${secrets.PGUSER} PGPASSWORD: ${secrets.PGPASSWORD} - run: (echo "BEGIN:"; cat .views/*.sql; echo "ROLLBACK;") | psql + run: | + for file in views/*.sql; + do + { + psql -c "BEGIN;\n $(cat $file)\n ROLLBACK;\n"; + } || { + echo "::error failed to run $file" + } + done