Skip to content

Commit 01dc091

Browse files
committed
ci: Apply PostgreSQL performance optimizations to GitHub Actions
1 parent 0f6c8f9 commit 01dc091

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

.github/workflows/ci.yml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,26 @@ jobs:
153153
needs: changed-files
154154
if: needs.changed-files.outputs.non-js == 'true'
155155

156+
services:
157+
postgres:
158+
image: postgres:16
159+
env:
160+
POSTGRES_PASSWORD: postgres
161+
options: >-
162+
--health-cmd pg_isready
163+
--health-interval 10s
164+
--health-timeout 5s
165+
--health-retries 5
166+
-c fsync=off
167+
-c wal_level=minimal
168+
-c full_page_writes=off
169+
-c checkpoint_timeout=10min
170+
-c shared_buffers=256MB
171+
-c synchronous_commit=off
172+
-c max_wal_senders=0
173+
ports:
174+
- 5432:5432
175+
156176
env:
157177
RUST_BACKTRACE: 1
158178
TEST_DATABASE_URL: postgres://postgres:postgres@localhost/postgres
@@ -171,10 +191,9 @@ jobs:
171191
with:
172192
save-if: ${{ github.ref == 'refs/heads/main' }}
173193

174-
# Update `pg_dump` to the same version as the running PostgreSQL server
194+
# Install PostgreSQL 16 client tools to match the service version
195+
# This ensures psql version matches PostgreSQL server for snapshot tests
175196
- run: sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -v ${POSTGRES_VERSION} -i -p
176-
- run: sudo systemctl start postgresql.service
177-
- run: sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'postgres'"
178197

179198
- run: cargo build --tests --workspace
180199
- run: cargo test --workspace

0 commit comments

Comments
 (0)