Skip to content

Commit 3bf3494

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.
1 parent b32a4e3 commit 3bf3494

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

.github/workflows/ci.yml

+12-5
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ 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
2021
mysql:
2122
image: mysql:latest
2223
env:
@@ -27,14 +28,20 @@ jobs:
2728
strategy:
2829
fail-fast: false
2930
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 ]
31+
os: [ubuntu-latest]
32+
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 ]
33+
include:
34+
- { os: ubuntu-22.04, ruby: "1.9.3" }
35+
- { os: ubuntu-22.04, ruby: jruby-9.1 }
36+
- { os: ubuntu-22.04, ruby: jruby-9.2 }
37+
runs-on: ${{ matrix.os }}
3138
name: ${{ matrix.ruby }}
3239
env:
3340
BUNDLE_GEMFILE: .ci.gemfile
3441
steps:
3542
- uses: actions/checkout@v4
36-
- run: sudo apt-get -yqq install libpq-dev
37-
- run: sudo apt-get -yqq install libmysqlclient-dev
43+
- run: sudo apt-get -yqq install libpq-dev libmysqlclient-dev libsqlite3-dev
44+
- run: sudo apt-get -yqq install libxml2-dev libxslt-dev
3845
- uses: ruby/setup-ruby@v1
3946
with:
4047
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)