diff --git a/.github/workflows/pull_request.yaml b/.github/workflows/pull_request.yaml index 2934f25c..1f27b577 100644 --- a/.github/workflows/pull_request.yaml +++ b/.github/workflows/pull_request.yaml @@ -19,6 +19,18 @@ jobs: build: runs-on: ubuntu-latest timeout-minutes: 15 + env: { PGHOST: "localhost", PGPORT: 5432, PGPASSWORD: "postgres" } + + services: + postgres: + image: postgres:14-alpine + env: + POSTGRES_USER: ${{ env.PGUSER }} + POSTGRES_PASSWORD: ${{ env.PGPASSWORD }} + POSTGRES_DB: ${{ env.PGDATABASE }} + ports: + - 5432:5432 + steps: - uses: actions/checkout@v2 - uses: actions/cache@v2 @@ -37,8 +49,9 @@ jobs: - run: yarn lint --no-cache # Test - - run: yarn test - run: yarn api:tsc + - run: yarn db:create + - run: yarn test # Compile - run: yarn api:build diff --git a/env/.prod.env b/env/.prod.env index 6d225d01..7af58534 100644 --- a/env/.prod.env +++ b/env/.prod.env @@ -35,7 +35,7 @@ PGDATABASE=app_prod # PGSSLCERT=../db/ssl/client-cert.prod.pem # PGSSLKEY=../db/ssl/client-key.prod.pem # PGSSLROOTCERT=../db/ssl/server-ca.prod.pem -# PGSERVERNAME=example-prod:pg13 +# PGSERVERNAME=example-prod:pg14 # Cloud storage bucket for user uploaded content and static assets # https://console.cloud.google.com/storage/browser diff --git a/env/.test.env b/env/.test.env index ebe13d00..71089f66 100644 --- a/env/.test.env +++ b/env/.test.env @@ -35,7 +35,7 @@ PGDATABASE=app_test # PGSSLCERT=../db/ssl/client-cert.test.pem # PGSSLKEY=../db/ssl/client-key.test.pem # PGSSLROOTCERT=../db/ssl/server-ca.test.pem -# PGSERVERNAME=example-test:pg13 +# PGSERVERNAME=example-test:pg14 # Cloud storage bucket for user uploaded content and static assets # https://console.cloud.google.com/storage/browser diff --git a/setup.js b/setup.js index e4d7f2e7..ed5f98bc 100644 --- a/setup.js +++ b/setup.js @@ -148,7 +148,7 @@ const questions = [ return ( replace(`env/.${env}.env`, gcp, `$1=${value}`) && replace(`env/.${env}.env`, db, `$1=${dbName}`) && - replace(`env/.${env}.env`, dbServer, `$1=${value}:pg13`) && + replace(`env/.${env}.env`, dbServer, `$1=${value}:pg14`) && (env === "test" ? replace(`env/.local.env`, gcp, `$1=${value}`) && replace(`env/.local.env`, db, `$1=${localDb}`)