Skip to content

Commit 0a0006d

Browse files
authored
CI and docs housekeeping (#754)
Changes: - support PG 15/16/17/18 - support OTP 24 as minimal OTP for Elixir 1.13 - bump actions/checkout - add changelog link to hex project info
1 parent 5ce8c28 commit 0a0006d

2 files changed

Lines changed: 43 additions & 17 deletions

File tree

.github/workflows/ci.yml

Lines changed: 39 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,38 +31,61 @@ jobs:
3131
fail-fast: false
3232
matrix:
3333
pg:
34-
- version: 9.4
34+
- version: "9.4"
3535
skip_wal: skip_wal
36-
- version: 9.5
36+
- version: "9.5"
3737
skip_wal: skip_wal
38-
- version: 9.6
38+
- version: "9.6"
3939
skip_wal: skip_wal
40-
- version: 10
41-
- version: 11
42-
- version: 12
43-
- version: 13
44-
- version: 14
40+
- version: "10"
41+
- version: "11"
42+
- version: "12"
43+
- version: "13"
44+
- version: "14"
45+
- version: "15"
46+
- version: "16"
47+
- version: "17"
48+
- version: "18"
4549

4650
pair:
47-
- elixir: 1.13
48-
otp: 25.3
51+
- elixir: "1.13"
52+
otp: "24"
4953
include:
5054
- pg:
51-
version: 14
55+
version: "18"
5256
pair:
53-
elixir: 1.18.1
54-
otp: 27.2
57+
elixir: "1.19"
58+
otp: "28"
5559
lint: lint
5660
env:
5761
MIX_ENV: test
5862
steps:
5963
- name: "Set PG settings"
6064
run: |
61-
docker exec ${{ job.services.pg.id }} sh -c 'echo "wal_level=logical" >> /var/lib/postgresql/data/postgresql.conf'
62-
docker restart ${{ job.services.pg.id }}
65+
PG_ID=${{ job.services.pg.id }}
66+
# PG 18 config path is different from previous versions
67+
# - /var/lib/postgresql/18/docker/postgresql.conf (PG 18)
68+
# - /var/lib/postgresql/data/postgresql.conf (PG 17 and below)
69+
70+
# Dynamically find the path to postgresql.conf using psql
71+
# We use the credentials from the service environment
72+
CONFIG_FILE=$(docker exec $PG_ID psql -U postgres -d postgres -t -A -c 'SHOW config_file;')
73+
74+
# Trim whitespace and ensure the path is valid
75+
CONFIG_FILE=$(echo $CONFIG_FILE | xargs)
76+
if [ -z "$CONFIG_FILE" ]; then
77+
echo "Error: Could not determine postgresql.conf path dynamically."
78+
exit 1
79+
fi
80+
81+
echo "Found config file at: $CONFIG_FILE"
82+
83+
# Use the discovered path to append the setting and restart the database
84+
docker exec $PG_ID sh -c 'echo "wal_level=logical" >> '"$CONFIG_FILE"
85+
docker restart $PG_ID
6386
if: ${{ matrix.pg.skip_wal }} != 'skip_wal'
6487

65-
- uses: actions/checkout@v2
88+
- uses: actions/checkout@v5
6689

6790
- uses: erlef/setup-beam@v1
6891
with:

mix.exs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,10 @@ defmodule Postgrex.Mixfile do
8080
[
8181
maintainers: ["Eric Meadows-Jönsson", "José Valim", "Greg Rychlewski", "Wojtek Mach"],
8282
licenses: ["Apache-2.0"],
83-
links: %{"GitHub" => @source_url}
83+
links: %{
84+
"GitHub" => @source_url,
85+
"Changelog" => "https://hexdocs.pm/postgrex/changelog.html"
86+
}
8487
]
8588
end
8689
end

0 commit comments

Comments
 (0)