Skip to content

Commit c669280

Browse files
authored
ci: Use the preconfigured Postgres image in CI workflows (#3600)
Simplify starting a Postgres database on CI. Having a [preconfigured image available](#3588) eliminates the need for manual configuration steps inside the CI job. This will also work great together with #3594.
1 parent 4a74617 commit c669280

File tree

3 files changed

+3
-19
lines changed

3 files changed

+3
-19
lines changed

.github/workflows/docker_image_smoketest.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,13 @@ jobs:
1919
runs-on: ubuntu-latest
2020
services:
2121
postgres:
22-
image: 'postgres:17-alpine'
22+
image: 'ghcr.io/${{ github.repository }}/postgres:17-alpine-logical'
2323
env:
2424
POSTGRES_PASSWORD: password
2525
ports:
2626
- 5432:5432
2727

2828
steps:
29-
- name: 'Set PG settings'
30-
run: |
31-
docker exec ${{ job.services.postgres.id }} sh -c 'echo "wal_level=logical" >> /var/lib/postgresql/data/postgresql.conf'
32-
docker restart ${{ job.services.postgres.id }}
33-
3429
- uses: docker/setup-buildx-action@v3
3530

3631
- uses: actions/checkout@v4

.github/workflows/elixir_client_tests.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
DATABASE_URL: 'postgresql://postgres:[email protected]:54323/postgres?sslmode=disable'
3434
services:
3535
postgres:
36-
image: postgres:14-alpine
36+
image: 'ghcr.io/${{ github.repository }}/postgres:17-alpine-logical'
3737
env:
3838
POSTGRES_PASSWORD: password
3939
options: >-
@@ -45,10 +45,6 @@ jobs:
4545
- 54323:5432
4646
steps:
4747
- uses: actions/checkout@v4
48-
- name: 'Set PG settings'
49-
run: |
50-
docker exec ${{ job.services.postgres.id }} sh -c 'echo "wal_level=logical" >> /var/lib/postgresql/data/postgresql.conf'
51-
docker restart ${{ job.services.postgres.id }}
5248

5349
- uses: erlef/setup-beam@v1
5450
with:

.github/workflows/elixir_tests.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
POSTGRES_VERSION: '${{ matrix.postgres_version }}0000'
4040
services:
4141
postgres:
42-
image: 'postgres:${{ matrix.postgres_version }}-alpine'
42+
image: 'ghcr.io/${{ github.repository }}/postgres:${{ matrix.postgres_version }}-alpine-logical'
4343
env:
4444
POSTGRES_PASSWORD: password
4545
options: >-
@@ -65,13 +65,6 @@ jobs:
6565
steps:
6666
- uses: actions/checkout@v4
6767

68-
# https://github.com/orgs/community/discussions/126453#discussioncomment-11414956
69-
- name: Set PG settings
70-
run: |
71-
docker exec ${{ job.services.postgres.id }} sh -c 'psql -U postgres -c "ALTER SYSTEM SET wal_level = '"'"'logical'"'"';"'
72-
docker exec ${{ job.services.postgres.id }} sh -c 'psql -U postgres -c "ALTER SYSTEM SET max_replication_slots = 100;"'
73-
docker restart ${{ job.services.postgres.id }}
74-
7568
- name: Seed the database
7669
run: psql -d postgresql://postgres:password@localhost:54321/postgres?sslmode=disable -f dev/init.sql
7770

0 commit comments

Comments
 (0)