CI: test against a Postgres service (embedded Postgres won't run as root)
CI / test (push) Successful in 1m5s
CI / test (push) Successful in 1m5s
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
b9dc3f0ec1
commit
7afada1c63
3 files changed
+19
-10
No files matched your search
+10
-8
@@ -1,4 +1,4 @@
|
||||
# Tests the hub (against a real Postgres: embedded, downloaded by the tests and cached) and builds it.
|
||||
# Tests the hub (against a real Postgres, a service container here) and builds it.
|
||||
name: CI
|
||||
|
||||
on:
|
||||
@@ -12,7 +12,15 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
GOPRIVATE: git.t5de.dev
|
||||
T5DE_PG_CACHE: /tmp/t5de-hub-postgres
|
||||
# Jobs run as root, which embedded Postgres refuses: the tests use this service instead.
|
||||
T5DE_TEST_DB: postgres://postgres:postgres@postgres:5432/postgres?sslmode=disable
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:17
|
||||
env:
|
||||
POSTGRES_PASSWORD: postgres
|
||||
options: >-
|
||||
--health-cmd "pg_isready -U postgres" --health-interval 2s --health-timeout 5s --health-retries 30
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
@@ -20,12 +28,6 @@ jobs:
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
|
||||
- name: Cache Postgres for the tests
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: /tmp/t5de-hub-postgres
|
||||
key: embedded-postgres-${{ runner.os }}-${{ hashFiles('go.sum') }}
|
||||
|
||||
- name: Test
|
||||
run: |
|
||||
unformatted=$(gofmt -l .)
|
||||
|
||||
Reference in new issue
Block a user