3333
3434 services :
3535 mysql :
36- image : mysql:5.7
36+ image : mysql:8
3737 ports :
3838 - 3306
3939
5656 with :
5757 ruby-version : ${{ matrix.ruby-version }}
5858 bundler-cache : true # runs 'bundle install' and caches installed gems automatically
59+ - name : Setup gdiff
60+ run : |
61+ sudo ln -s /usr/bin/diff /usr/bin/gdiff || true
5962 - name : Setup database
6063 run : |
6164 sudo service mysql start
@@ -89,10 +92,10 @@ jobs:
8992
9093 services :
9194 postgres :
92- image : postgres:11
95+ image : postgres:17
9396 env :
9497 POSTGRES_PASSWORD : postgres
95- POSTGRES_HOST_AUTH_METHOD : trust
98+ POSTGRES_DB : postgres
9699 ports :
97100 - 5432:5432
98101 options : --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
@@ -104,7 +107,8 @@ jobs:
104107 PREPARED_STATEMENTS : ${{ matrix.prepared_statements }}
105108 PGHOST : localhost
106109 PGPORT : 5432
107- PGUSER : postgres
110+ PGUSER : arjdbc
111+ PGPASSWORD : arjdbc
108112
109113 steps :
110114 - uses : actions/checkout@v4
@@ -118,10 +122,23 @@ jobs:
118122 with :
119123 ruby-version : ${{ matrix.ruby-version }}
120124 bundler-cache : true # runs 'bundle install' and caches installed gems automatically
125+ - name : Install PostgreSQL 17 client
126+ run : |
127+ sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
128+ wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
129+ sudo apt-get update
130+ sudo apt-get install -y postgresql-client-17
131+ - name : Setup gdiff
132+ run : |
133+ sudo ln -s /usr/bin/diff /usr/bin/gdiff || true
121134 - name : Setup database
122135 run : |
123- psql -c "create database activerecord_unittest;" -U postgres
124- psql -c "create database activerecord_unittest2;" -U postgres
136+ PGPASSWORD=postgres psql -h localhost -U postgres -c "CREATE USER arjdbc WITH SUPERUSER CREATEDB LOGIN PASSWORD 'arjdbc';"
137+ echo "Testing connection as arjdbc user..."
138+ PGPASSWORD=arjdbc psql -h localhost -d postgres -U arjdbc -c '\l'
139+ echo "Exit status: $?"
140+ PGPASSWORD=arjdbc psql -h localhost -d postgres -c "create database activerecord_unittest;" -U arjdbc
141+ PGPASSWORD=arjdbc psql -h localhost -d postgres -c "create database activerecord_unittest2;" -U arjdbc
125142 - name : Build
126143 run : |
127144 rake jar # compiles ext generates: lib/arjdbc/jdbc/adapter_java.jar
@@ -158,6 +175,9 @@ jobs:
158175 with :
159176 ruby-version : ${{ matrix.ruby-version }}
160177 bundler-cache : true # runs 'bundle install' and caches installed gems automatically
178+ - name : Setup gdiff
179+ run : |
180+ sudo ln -s /usr/bin/diff /usr/bin/gdiff || true
161181 - name : Build
162182 run : |
163183 echo "JAVA_OPTS=$JAVA_OPTS"
@@ -181,7 +201,7 @@ jobs:
181201
182202 services :
183203 mysql :
184- image : mysql:5.7
204+ image : mysql:8
185205 ports :
186206 - 3306
187207
@@ -231,10 +251,10 @@ jobs:
231251
232252 services :
233253 postgres :
234- image : postgres:11
254+ image : postgres:17
235255 env :
236256 POSTGRES_PASSWORD : postgres
237- POSTGRES_HOST_AUTH_METHOD : trust
257+ POSTGRES_DB : postgres
238258 ports :
239259 - 5432:5432
240260 options : --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
@@ -247,7 +267,8 @@ jobs:
247267 INSERT_RETURNING : ${{ matrix.insert_returning }}
248268 PGHOST : localhost
249269 PGPORT : 5432
250- PGUSER : postgres
270+ PGUSER : arjdbc
271+ PGPASSWORD : arjdbc
251272
252273 steps :
253274 - uses : actions/checkout@v4
@@ -261,6 +282,20 @@ jobs:
261282 with :
262283 ruby-version : ${{ matrix.ruby-version }}
263284 bundler-cache : true # runs 'bundle install' and caches installed gems automatically
285+ - name : Install PostgreSQL 17 client
286+ run : |
287+ sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
288+ wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
289+ sudo apt-get update
290+ sudo apt-get install -y postgresql-client-17
291+ - name : Setup PostgreSQL user
292+ run : |
293+ PGPASSWORD=postgres psql -h localhost -U postgres -c "CREATE USER arjdbc WITH SUPERUSER CREATEDB LOGIN PASSWORD 'arjdbc';"
294+ - name : Test PostgreSQL connection
295+ run : |
296+ echo "Testing connection as arjdbc user..."
297+ PGPASSWORD=arjdbc psql -h localhost -d postgres -U arjdbc -c '\l'
298+ echo "Exit status: $?"
264299 - name : Build
265300 run : |
266301 rake jar
0 commit comments