From c36ead4b74c6f1ed395e89dae26c5b3630d469a4 Mon Sep 17 00:00:00 2001 From: Jaanus Sellin Date: Wed, 7 Aug 2024 11:12:45 +0300 Subject: [PATCH] feat: wait for postgres to boot before running tests (#7790) Tests were failing on this workflow due to postgres taking longer to boot up, now it will wait for postgres to boot up before continuing. --- .github/workflows/publish-new-version.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/publish-new-version.yaml b/.github/workflows/publish-new-version.yaml index 2cc304ebfa..3deb469d76 100644 --- a/.github/workflows/publish-new-version.yaml +++ b/.github/workflows/publish-new-version.yaml @@ -32,6 +32,21 @@ jobs: matrix: node-version: [ 20.x ] + services: + # Label used to access the service container + postgres: + # Docker Hub image + image: postgres + # Provide the password for postgres + env: + POSTGRES_PASSWORD: postgres + POSTGRES_INITDB_ARGS: "--no-sync" + # Set health checks to wait until postgres has started + ports: + - 5432:5432 + options: >- + --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 + steps: - uses: actions/checkout@v4 with: