From 8c12c329f117727528b3c2ad5eb37313f5349407 Mon Sep 17 00:00:00 2001 From: George Hickman Date: Tue, 21 Nov 2023 14:41:44 +0000 Subject: [PATCH] Set up timescaledb as a service in CI --- .github/workflows/main.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 93cb863b..62d4e5d6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,13 +26,32 @@ jobs: test: runs-on: ubuntu-latest + services: + timescaledb: + build: + dockerfile: timescaledb/Dockerfile + env: + POSTGRES_USER: user + POSTGRES_PASSWORD: password + POSTGRES_DB: metrics + TIMESCALEDB_TELEMETRY: off + ports: + - 5432:5432 + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 steps: - uses: actions/checkout@v4 - uses: "opensafely-core/setup-action@v1" with: python-version: "3.11" install-just: true + - name: Run tests + env: + TIMESCALEDB_URL: postgresql://user:password@localhost/metrics run: | just test