You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
until pg_isready -h localhost -p 5432 -U postgres; do
45
-
echo "Waiting for postgres..."
46
-
sleep 2
47
-
done
24
+
# Configure PostgreSQL for pg_stat_statements
25
+
sudo sed -i "s/#shared_preload_libraries = ''/shared_preload_libraries = 'pg_stat_statements'/" /etc/postgresql/*/main/postgresql.conf
26
+
sudo systemctl start postgresql.service
27
+
pg_isready
28
+
29
+
# Create runner user and test database
30
+
sudo -u postgres createuser -s runner
31
+
sudo -u postgres createdb test
48
32
49
33
- name: Prepare test database
50
34
run: |
51
35
# Create extensions (they need to be created by superuser)
52
-
PGPASSWORD=postgres psql -h localhost -U postgres -d test -c 'CREATE EXTENSION IF NOT EXISTS pg_stat_statements;'
53
-
PGPASSWORD=postgres psql -h localhost -U postgres -d test -c 'CREATE EXTENSION IF NOT EXISTS pgstattuple;'
36
+
sudo -u postgres psql -d test -c 'CREATE EXTENSION IF NOT EXISTS pg_stat_statements;'
37
+
sudo -u postgres psql -d test -c 'CREATE EXTENSION IF NOT EXISTS pgstattuple;'
54
38
55
39
# Create test tables
56
-
PGPASSWORD=postgres psql -h localhost -U postgres -d test -c "CREATE TABLE align1 AS SELECT 1::int4, 2::int8, 3::int4 AS more FROM generate_series(1, 100000) _(i);"
57
-
PGPASSWORD=postgres psql -h localhost -U postgres -d test -c "CREATE TABLE align2 AS SELECT 1::int4, 3::int4 AS more, 2::int8 FROM generate_series(1, 100000) _(i);"
40
+
psql -d test -c "CREATE TABLE align1 AS SELECT 1::int4, 2::int8, 3::int4 AS more FROM generate_series(1, 100000) _(i);"
41
+
psql -d test -c "CREATE TABLE align2 AS SELECT 1::int4, 3::int4 AS more, 2::int8 FROM generate_series(1, 100000) _(i);"
continue-on-error: true # Allow beta tests to fail without breaking CI
94
-
95
-
strategy:
96
-
matrix:
97
-
postgres-version: ['18-beta']
98
-
99
-
services:
100
-
postgres:
101
-
image: postgres:${{ matrix.postgres-version }}
102
-
env:
103
-
POSTGRES_PASSWORD: postgres
104
-
POSTGRES_DB: test
105
-
POSTGRES_USER: postgres
106
-
options: >-
107
-
--health-cmd pg_isready
108
-
--health-interval 10s
109
-
--health-timeout 5s
110
-
--health-retries 5
111
-
ports:
112
-
- 5432:5432
113
-
114
-
steps:
115
-
- name: Checkout code
116
-
uses: actions/checkout@v4
117
-
118
-
- name: Install PostgreSQL client (beta)
119
-
run: |
120
-
sudo apt-get update
121
-
# Install latest PostgreSQL client for beta testing
122
-
sudo apt-get install -y postgresql-client
123
-
124
-
- name: Wait for PostgreSQL to be ready
125
-
run: |
126
-
until pg_isready -h localhost -p 5432 -U postgres; do
127
-
echo "Waiting for postgres..."
128
-
sleep 2
129
-
done
130
-
131
-
- name: Prepare test database
132
-
run: |
133
-
# Create extensions (they need to be created by superuser)
134
-
PGPASSWORD=postgres psql -h localhost -U postgres -d test -c 'CREATE EXTENSION IF NOT EXISTS pg_stat_statements;'
135
-
PGPASSWORD=postgres psql -h localhost -U postgres -d test -c 'CREATE EXTENSION IF NOT EXISTS pgstattuple;'
136
-
137
-
# Create test tables
138
-
PGPASSWORD=postgres psql -h localhost -U postgres -d test -c "CREATE TABLE align1 AS SELECT 1::int4, 2::int8, 3::int4 AS more FROM generate_series(1, 100000) _(i);"
139
-
PGPASSWORD=postgres psql -h localhost -U postgres -d test -c "CREATE TABLE align2 AS SELECT 1::int4, 3::int4 AS more, 2::int8 FROM generate_series(1, 100000) _(i);"
0 commit comments