From e6313985711badab712a1c7a38fe90881dbe8d4d Mon Sep 17 00:00:00 2001 From: Sujay Jayakar Date: Tue, 7 Jan 2025 14:49:44 -0800 Subject: [PATCH 1/3] Add Postgres to CI environment --- .github/workflows/build_local_backend.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/build_local_backend.yml b/.github/workflows/build_local_backend.yml index be799035..99a27098 100644 --- a/.github/workflows/build_local_backend.yml +++ b/.github/workflows/build_local_backend.yml @@ -17,6 +17,25 @@ jobs: build_and_test: name: Build and Test Convex Backend runs-on: [self-hosted, aws, x64, xlarge] + + services: + # Label used to access service container + postgres: + # Docker Hub image + image: bitnami/postgresql:13 + # Provide the password for postgres + env: + POSTGRESQL_PASSWORD: postgres + POSTGRESQL_MAX_CONNECTIONS: 500 + POSTGRESQL_REPLICATION_USE_PASSFILE: no + # Set health checks to wait until postgres has started + options: >- + --health-cmd "pg_isready -U postgres" --health-interval 10s + --health-timeout 5s --health-retries 5 --name postgres + ports: + # Maps tcp port 5432 on service container to the host + - 5432:5432 + steps: - name: Checkout repo uses: actions/checkout@v4 From 1a22f0806a8dfb606c6519e2cc457d529d432710 Mon Sep 17 00:00:00 2001 From: Sujay Jayakar Date: Wed, 8 Jan 2025 12:01:15 -0800 Subject: [PATCH 2/3] Update build_local_backend.yml --- .github/workflows/build_local_backend.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_local_backend.yml b/.github/workflows/build_local_backend.yml index 99a27098..4e86f5a8 100644 --- a/.github/workflows/build_local_backend.yml +++ b/.github/workflows/build_local_backend.yml @@ -80,7 +80,10 @@ jobs: uses: taiki-e/install-action@cargo-nextest - name: Build rust tests - run: cargo nextest run --no-run --profile ci + env: + CI_PGUSER: postgres + CI_PGPASSWORD: postgres + run: cargo nextest run --no-run --profile ci - name: Run Rust tests run: DISABLE_FUZZY_TEXT_SEARCH=true cargo nextest run --profile ci From be744776588a8646caf71653fb13d9975881bf34 Mon Sep 17 00:00:00 2001 From: Sujay Jayakar Date: Wed, 8 Jan 2025 13:17:30 -0800 Subject: [PATCH 3/3] Update build_local_backend.yml --- .github/workflows/build_local_backend.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_local_backend.yml b/.github/workflows/build_local_backend.yml index 4e86f5a8..ab00b2e6 100644 --- a/.github/workflows/build_local_backend.yml +++ b/.github/workflows/build_local_backend.yml @@ -80,10 +80,10 @@ jobs: uses: taiki-e/install-action@cargo-nextest - name: Build rust tests - env: - CI_PGUSER: postgres - CI_PGPASSWORD: postgres run: cargo nextest run --no-run --profile ci - name: Run Rust tests + env: + CI_PGUSER: postgres + CI_PGPASSWORD: postgres run: DISABLE_FUZZY_TEXT_SEARCH=true cargo nextest run --profile ci