Skip to content

Commit 714c082

Browse files
committed
Try to run most of CI on ubuntu-latest
Use ubuntu-22.04 for Ruby 1.9.3 and JRuby 9.1/9.2. Use sequel-postgres-pr instead of pg on Ruby 1.9-2.3, since the pg gem segfaults consistently on ubuntu-latest in CI on those versions.
1 parent b32a4e3 commit 714c082

File tree

3 files changed

+23
-11
lines changed

3 files changed

+23
-11
lines changed

.ci.gemfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ elsif RUBY_VERSION >= '2.1'
2828
end
2929

3030
platforms :ruby do
31-
if RUBY_VERSION < '2.0'
32-
gem "pg", '<0.19.0'
31+
if RUBY_VERSION < '2.4'
32+
gem "sequel-postgres-pr"
3333
else
3434
gem "pg"
3535
end

.github/workflows/ci.yml

+14-5
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,15 @@ permissions:
1111

1212
jobs:
1313
tests:
14-
runs-on: ubuntu-20.04
1514
services:
1615
postgres:
17-
image: postgres:11.5
16+
image: postgres:latest
1817
ports: ["5432:5432"]
1918
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
19+
env:
20+
POSTGRES_PASSWORD: postgres
21+
POSTGRES_HOST_AUTH_METHOD: md5
22+
POSTGRES_INITDB_ARGS: --auth-host=md5
2023
mysql:
2124
image: mysql:latest
2225
env:
@@ -27,14 +30,20 @@ jobs:
2730
strategy:
2831
fail-fast: false
2932
matrix:
30-
ruby: [ "1.9.3", "2.0.0", 2.1, 2.3, 2.4, 2.5, 2.6, 2.7, "3.0", 3.1, 3.2, 3.3, 3.4, jruby-9.1, jruby-9.2, jruby-9.3, jruby-9.4 ]
33+
os: [ubuntu-latest]
34+
ruby: [ "2.0.0", 2.1, 2.3, 2.4, 2.5, 2.6, 2.7, "3.0", 3.1, 3.2, 3.3, 3.4, jruby-9.3, jruby-9.4 ]
35+
include:
36+
- { os: ubuntu-22.04, ruby: "1.9.3" }
37+
- { os: ubuntu-22.04, ruby: jruby-9.1 }
38+
- { os: ubuntu-22.04, ruby: jruby-9.2 }
39+
runs-on: ${{ matrix.os }}
3140
name: ${{ matrix.ruby }}
3241
env:
3342
BUNDLE_GEMFILE: .ci.gemfile
3443
steps:
3544
- uses: actions/checkout@v4
36-
- run: sudo apt-get -yqq install libpq-dev
37-
- run: sudo apt-get -yqq install libmysqlclient-dev
45+
- run: sudo apt-get -yqq install libpq-dev libmysqlclient-dev libsqlite3-dev
46+
- run: sudo apt-get -yqq install libxml2-dev libxslt-dev
3847
- uses: ruby/setup-ruby@v1
3948
with:
4049
ruby-version: ${{ matrix.ruby }}

Rakefile

+7-4
Original file line numberDiff line numberDiff line change
@@ -168,15 +168,18 @@ task :spec_ci do
168168
end
169169

170170
if RUBY_ENGINE == 'jruby'
171-
pg_db = "jdbc:postgresql://localhost/#{pg_database}?user=postgres"
171+
pg_db = "jdbc:postgresql://localhost/#{pg_database}?user=postgres&password=postgres"
172172
my_db = "jdbc:mysql://#{mysql_host}/rodauth_test?user=root#{mysql_password}&useSSL=false&allowPublicKeyRetrieval=true"
173173
else
174-
pg_db = "postgres://localhost/#{pg_database}?user=postgres"
174+
pg_db = "postgres://localhost/#{pg_database}?user=postgres&password=postgres"
175175
my_db = "mysql2://#{mysql_host}/rodauth_test?user=root#{mysql_password}&useSSL=false"
176176
end
177177

178-
sh "psql -U postgres -h localhost -c 'CREATE EXTENSION citext' #{pg_database}"
179-
sh "psql -U postgres -h localhost -c 'CREATE EXTENSION pgcrypto' #{pg_database}" if ENV['RODAUTH_SPEC_UUID']
178+
require "sequel/core"
179+
Sequel.connect(pg_db) do |db|
180+
db.run 'CREATE EXTENSION citext'
181+
db.run 'CREATE EXTENSION pgcrypto' if ENV['RODAUTH_SPEC_UUID']
182+
end
180183
spec.call('RODAUTH_SPEC_MIGRATE'=>'1', 'RODAUTH_SPEC_DB'=>pg_db)
181184

182185
if RUBY_VERSION >= '2.4'

0 commit comments

Comments
 (0)