From 43a967ef376e10cbc1dbd96db610613429914e7b Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Mon, 9 Dec 2024 18:23:19 -0800 Subject: [PATCH] ci: postgres service --- .github/workflows/pr.yaml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index c6d94949..5f31979e 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -5,6 +5,24 @@ on: jobs: pr: runs-on: ubuntu-latest + services: + postgres: + image: postgres:16-alpine + ports: + - 5432:5432 + env: + POSTGRES_PASSWORD: postgres + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + env: + DB_USER: postgres + DB_PASS: postgres + DB_DATABASE: postgres + DB_HOST: localhost + DB_PORT: 5432 steps: - uses: actions/checkout@v4 # Before setup-node because that action runs `yarn cache dir`. See https://github.com/actions/setup-node/issues/480#issuecomment-1915448139 @@ -24,6 +42,8 @@ jobs: - name: Build run: yarn build # TODO: https://github.com/Agoric/agoric-subql/issues/8 + - name: Enable btree btree_gist + run: psql "postgresql://$DB_USER:$DB_PASS@$DB_HOST:$DB_PORT/$DB_DATABASE" -c "CREATE EXTENSION IF NOT EXISTS btree_gist;" # - name: Install subql-node-cosmos # run: yarn global add @subql/node-cosmos # - name: Run tests with Subquery Node