Skip to content

Commit 8314b4d

Browse files
Add Ruby 3 and Mongo 5 to CI (#14)
1 parent b77e12b commit 8314b4d

File tree

7 files changed

+27
-24
lines changed

7 files changed

+27
-24
lines changed

.github/workflows/test-mongodb.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ jobs:
88
matrix:
99
entry:
1010
- { ruby: 2.6.2, mongoid: 6.4.8, mongodb: 4.4 }
11-
- { ruby: 2.6.2, mongoid: 7.2.3, mongodb: 4.4 }
12-
- { ruby: 2.6.2, mongoid: 7.3.0, mongodb: 4.4 }
11+
- { ruby: 2.7.2, mongoid: 7.3.0, mongodb: 5.0 }
12+
- { ruby: 3.1.1, mongoid: 7.3.0, mongodb: 5.0 }
1313
name: test (ruby=${{ matrix.entry.ruby }}, mongoid=${{ matrix.entry.mongoid }}, mongodb=${{ matrix.entry.mongodb }})
1414
steps:
1515
- uses: actions/checkout@v2
@@ -25,4 +25,5 @@ jobs:
2525
bundle exec rake spec
2626
env:
2727
DATABASE_ADAPTER: mongoid
28+
DATABASE_URL: "mongodb://localhost"
2829
MONGOID_VERSION: ${{ matrix.entry.mongoid }}

.github/workflows/test-postgresql.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,16 @@ jobs:
88
matrix:
99
entry:
1010
- { ruby: 2.6.2, postgresql: 11 }
11-
- { ruby: 2.6.2, postgresql: 14 }
11+
- { ruby: 2.7.2, postgresql: 14 }
12+
- { ruby: 3.1.1, postgresql: 14 }
1213
name: test (ruby=${{ matrix.entry.ruby }}, postgresql=${{ matrix.entry.postgresql }})
1314
services:
1415
postgres:
1516
image: postgres:${{ matrix.entry.postgresql }}
1617
env:
1718
POSTGRES_USER: test
1819
POSTGRES_PASSWORD: password
19-
POSTGRES_DB: slack_ruby_bot_server_slack_test
20+
POSTGRES_DB: slack_ruby_bot_server_events_test
2021
ports:
2122
- 5432:5432
2223
# needed because the postgres container does not provide a healthcheck
@@ -32,4 +33,4 @@ jobs:
3233
bundle exec rake spec
3334
env:
3435
DATABASE_ADAPTER: activerecord
35-
DATABASE_URL: postgres://test:password@localhost/slack_ruby_bot_server_slack_test
36+
DATABASE_URL: postgres://test:password@localhost/slack_ruby_bot_server_events_test

CHANGELOG.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,22 @@
33
#### 0.3.2 (Next)
44

55
* [#13](https://github.com/slack-ruby/slack-ruby-bot-server-events/pull/13): Replace Travis CI with Github Actions - [@CrazyOptimist](https://github.com/CrazyOptimist).
6-
* Your contribution here.
76
* [#10](https://github.com/slack-ruby/slack-ruby-bot-server-events/pull/10): Fix actions endpoint for block dropdowns - [@maths22](https://github.com/maths22).
7+
* [#14](https://github.com/slack-ruby/slack-ruby-bot-server-events/pull/14): Added support for Ruby 3.1 - [@CrazyOptimist](https://github.com/CrazyOptimist).
8+
* Your contribution here.
89

9-
#### 0.3.1 (2/4/2021)
10+
#### 0.3.1 (2021/02/04)
1011

1112
* [#9](https://github.com/slack-ruby/slack-ruby-bot-server-events/pull/9): Provide default value when actions are missing in payload - [@nijave](https://github.com/nijave).
1213

13-
#### 0.3.0 (12/30/2020)
14+
#### 0.3.0 (2020/12/30)
1415

1516
* [#6](https://github.com/slack-ruby/slack-ruby-bot-server-events/pull/6): Add support for block_actions interaction type - [@CrazyOptimist](https://github.com/CrazyOptimist).
1617

17-
#### 0.2.0 (07/19/2020)
18+
#### 0.2.0 (2020/07/19)
1819

1920
* Include action type in actions callbacks - [@dblock](https://github.com/dblock).
2021

21-
#### 0.1.0 (07/19/2020)
22+
#### 0.1.0 (2020/07/19)
2223

2324
* Initial public release - [@dblock](https://github.com/dblock).

Gemfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ when 'mongoid' then
88
gem 'mongoid'
99
gem 'mongoid-scroll'
1010
when 'activerecord' then
11-
gem 'activerecord', '~> 5.0.0'
12-
gem 'otr-activerecord', '~> 1.2.1'
11+
gem 'activerecord'
12+
gem 'otr-activerecord'
1313
gem 'virtus'
14-
gem 'cursor_pagination' # rubocop:disable Bundler/OrderedGems
14+
gem 'cursor_pagination', github: 'dblock/cursor_pagination', branch: 'misc' # rubocop:disable Bundler/OrderedGems
1515
gem 'pg'
1616
when nil
1717
warn "Missing ENV['DATABASE_ADAPTER']."
Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# frozen_string_literal: true
22

3-
db_config = YAML.safe_load(
4-
ERB.new(File.read(
5-
File.expand_path('postgresql.yml', __dir__)
6-
)).result, [], [], true
7-
)[ENV['RACK_ENV']]
3+
yml = ERB.new(File.read(File.expand_path('postgresql.yml', __dir__))).result
4+
db_config = if Gem::Version.new(Psych::VERSION) >= Gem::Version.new('3.1.0.pre1')
5+
::YAML.safe_load(yml, aliases: true)[ENV['RACK_ENV']]
6+
else
7+
::YAML.safe_load(yml, [], [], true)[ENV['RACK_ENV']]
8+
end
89
ActiveRecord::Tasks::DatabaseTasks.create(db_config)
910
ActiveRecord::Base.establish_connection(db_config)
11+
ActiveRecord::Base.logger ||= Logger.new(STDOUT)
1012
ActiveRecord::Base.logger.level = :info

spec/database_adapters/activerecord/postgresql.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ default: &default
66

77
development:
88
<<: *default
9-
database: slack_ruby_bot_server_slack_development
9+
database: slack_ruby_bot_server_events_development
1010

1111
test:
1212
<<: *default
13-
database: slack_ruby_bot_server_slack_test
13+
database: slack_ruby_bot_server_events_test
1414
url: <%= ENV["DATABASE_URL"] %>
1515

1616
production:
1717
<<: *default
18-
database: slack_ruby_bot_server_slack_production
18+
database: slack_ruby_bot_server_events_production

spec/database_adapters/mongoid/mongoid.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ development:
1111
test:
1212
clients:
1313
default:
14-
database: slack-ruby-bot-server-events_test
15-
hosts:
16-
- 127.0.0.1:27017
14+
uri: <%= ENV["DATABASE_URL"] %>
1715
options:
1816
raise_not_found_error: false
1917
use_utc: true

0 commit comments

Comments
 (0)