Skip to content
This repository was archived by the owner on Sep 29, 2025. It is now read-only.

Commit 0ce36f8

Browse files
committed
Replaced Travis CI with GHA.
1 parent bdb5ff5 commit 0ce36f8

File tree

27 files changed

+236
-44
lines changed

27 files changed

+236
-44
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: [dblock]

.github/workflows/danger.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
name: danger
3+
on: [pull_request]
4+
jobs:
5+
danger:
6+
runs-on: ubuntu-latest
7+
env:
8+
BUNDLE_GEMFILE: Gemfile.danger
9+
steps:
10+
- uses: actions/checkout@v2
11+
with:
12+
fetch-depth: 0
13+
- name: Set up Ruby
14+
uses: ruby/setup-ruby@v1
15+
with:
16+
ruby-version: '2.7'
17+
bundler-cache: true
18+
- name: Run Danger
19+
run: |
20+
# the personal token is public, this is ok, base64 encode to avoid tripping Github
21+
TOKEN=$(echo -n Z2hwX0xNQ3VmanBFeTBvYkZVTWh6NVNqVFFBOEUxU25abzBqRUVuaAo= | base64 --decode)
22+
DANGER_GITHUB_API_TOKEN=$TOKEN bundle exec danger --verbose

.github/workflows/rubocop.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: lint
3+
on: [push, pull_request]
4+
jobs:
5+
lint:
6+
name: RuboCop
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
- name: Set up Ruby
11+
uses: ruby/setup-ruby@v1
12+
with:
13+
ruby-version: '3.4'
14+
bundler-cache: true
15+
- name: Run RuboCop
16+
run: bundle exec rubocop

.github/workflows/test-mongodb.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
name: test
3+
on: [push, pull_request]
4+
jobs:
5+
test:
6+
runs-on: ubuntu-latest
7+
name: test
8+
env:
9+
DATABASE_ADAPTER: mongoid
10+
BUNDLE_GEMFILE: Gemfile
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: ruby/setup-ruby@v1
14+
with:
15+
ruby-version: '3.4'
16+
bundler-cache: true
17+
- uses: supercharge/[email protected]
18+
with:
19+
mongodb-version: '8.0'
20+
- run: bundle exec rake spec
21+
- working-directory: sample_apps/sample_app_mongoid
22+
env:
23+
RACK_ENV: test
24+
run: |
25+
bundle install
26+
bundle exec rake
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
name: test
3+
on: [push, pull_request]
4+
jobs:
5+
test:
6+
runs-on: ubuntu-latest
7+
name: test
8+
services:
9+
postgres:
10+
image: postgres:17
11+
env:
12+
POSTGRES_USER: test
13+
POSTGRES_PASSWORD: password
14+
POSTGRES_DB: slack_ruby_bot_server_slack_test
15+
ports:
16+
- 5432:5432
17+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
18+
env:
19+
DATABASE_ADAPTER: activerecord
20+
DATABASE_URL: postgres://test:password@localhost/slack_ruby_bot_server_slack_test
21+
BUNDLE_GEMFILE: Gemfile
22+
RACK_ENV: test
23+
steps:
24+
- uses: actions/checkout@v2
25+
- uses: ruby/setup-ruby@v1
26+
with:
27+
ruby-version: '3.4'
28+
bundler-cache: true
29+
- run: bundle exec rake spec
30+
- working-directory: sample_apps/sample_app_activerecord
31+
run: |
32+
bundle install
33+
bundle exec rake
34+

.rubocop.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
AllCops:
2+
NewCops: enable
3+
14
Metrics:
25
Enabled: false
36

@@ -13,3 +16,6 @@ Style/ModuleFunction:
1316

1417
inherit_from: .rubocop_todo.yml
1518

19+
plugins:
20+
- rubocop-rake
21+
- rubocop-rspec

.rubocop_todo.yml

Lines changed: 78 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,104 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2020-11-27 15:32:33 -0500 using RuboCop version 0.81.0.
3+
# on 2025-09-29 12:37:09 UTC using RuboCop version 1.81.1.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
77
# versions of RuboCop, may require this file to be generated again.
88

9+
# Offense count: 1
10+
# Configuration parameters: Severity.
11+
Gemspec/RequiredRubyVersion:
12+
Exclude:
13+
- 'slack-ruby-bot-server-rtm.gemspec'
14+
15+
# Offense count: 1
16+
# Configuration parameters: AllowComments, AllowEmptyLambdas.
17+
Lint/EmptyBlock:
18+
Exclude:
19+
- 'spec/slack-ruby-bot-server-rtm/config_spec.rb'
20+
921
# Offense count: 1
1022
# Configuration parameters: IgnoreImplicitReferences.
1123
Lint/ShadowedArgument:
1224
Exclude:
1325
- 'lib/slack-ruby-bot-server-rtm/lifecycle.rb'
1426

1527
# Offense count: 2
16-
# Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts, AllowedAcronyms.
28+
# Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, CheckDefinitionPathHierarchyRoots, Regex, IgnoreExecutableScripts, AllowedAcronyms.
29+
# CheckDefinitionPathHierarchyRoots: lib, spec, test, src
1730
# AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
1831
Naming/FileName:
1932
Exclude:
33+
- 'Rakefile.rb'
2034
- 'lib/slack-ruby-bot-server-rtm.rb'
2135
- 'lib/slack-ruby-bot-server-rtm/ext/slack-ruby-bot.rb'
2236

2337
# Offense count: 2
2438
# Configuration parameters: ForbiddenDelimiters.
25-
# ForbiddenDelimiters: (?-mix:(^|\s)(EO[A-Z]{1}|END)(\s|$))
39+
# ForbiddenDelimiters: (?i-mx:(^|\s)(EO[A-Z]{1}|END)(\s|$))
2640
Naming/HeredocDelimiterNaming:
2741
Exclude:
2842
- 'sample_apps/sample_app_activerecord/commands/help.rb'
2943
- 'sample_apps/sample_app_mongoid/commands/help.rb'
44+
45+
# Offense count: 2
46+
RSpec/AnyInstance:
47+
Exclude:
48+
- 'spec/slack-ruby-bot-server-rtm/lifecycle_spec.rb'
49+
50+
# Offense count: 7
51+
# Configuration parameters: Prefixes, AllowedPatterns.
52+
# Prefixes: when, with, without
53+
RSpec/ContextWording:
54+
Exclude:
55+
- 'sample_apps/sample_app_activerecord/spec/commands/whoami_spec.rb'
56+
- 'sample_apps/sample_app_mongoid/spec/commands/whoami_spec.rb'
57+
- 'spec/slack-ruby-bot-server-rtm/lifecycle_spec.rb'
58+
- 'spec/slack-ruby-bot-server-rtm/server_spec.rb'
59+
60+
# Offense count: 1
61+
# This cop supports unsafe autocorrection (--autocorrect-all).
62+
# Configuration parameters: SkipBlocks, EnforcedStyle, OnlyStaticConstants.
63+
# SupportedStyles: described_class, explicit
64+
RSpec/DescribedClass:
65+
Exclude:
66+
- 'spec/slack-ruby-bot-server-rtm/server_spec.rb'
67+
68+
# Offense count: 1
69+
# This cop supports unsafe autocorrection (--autocorrect-all).
70+
RSpec/EmptyExampleGroup:
71+
Exclude:
72+
- 'spec/slack-ruby-bot-server-rtm/config_spec.rb'
73+
74+
# Offense count: 7
75+
# Configuration parameters: .
76+
# SupportedStyles: have_received, receive
77+
RSpec/MessageSpies:
78+
EnforcedStyle: receive
79+
80+
# Offense count: 5
81+
RSpec/MultipleExpectations:
82+
Max: 2
83+
84+
# Offense count: 4
85+
# Configuration parameters: EnforcedStyle, IgnoreSharedExamples.
86+
# SupportedStyles: always, named_only
87+
RSpec/NamedSubject:
88+
Exclude:
89+
- 'spec/slack-ruby-bot-server-rtm/server_spec.rb'
90+
91+
# Offense count: 4
92+
# Configuration parameters: CustomTransform, IgnoreMethods, IgnoreMetadata.
93+
RSpec/SpecFilePathFormat:
94+
Exclude:
95+
- '**/spec/routing/**/*'
96+
- 'spec/slack-ruby-bot-server-rtm/config_spec.rb'
97+
- 'spec/slack-ruby-bot-server-rtm/lifecycle_spec.rb'
98+
- 'spec/slack-ruby-bot-server-rtm/server_spec.rb'
99+
- 'spec/slack-ruby-bot-server-rtm/version_spec.rb'
100+
101+
# Offense count: 1
102+
RSpec/SubjectStub:
103+
Exclude:
104+
- 'spec/slack-ruby-bot-server-rtm/server_spec.rb'

.travis.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

Gemfile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
source 'https://rubygems.org'
44

5-
case ENV['DATABASE_ADAPTER']
6-
when 'mongoid' then
5+
case ENV.fetch('DATABASE_ADAPTER', nil)
6+
when 'mongoid'
77
gem 'kaminari-mongoid'
88
gem 'mongoid'
99
gem 'mongoid-scroll'
10-
when 'activerecord' then
10+
when 'activerecord'
1111
gem 'activerecord', '~> 5.0.0'
1212
gem 'otr-activerecord', '~> 1.2.1'
1313
gem 'virtus'
@@ -16,7 +16,7 @@ when 'activerecord' then
1616
when nil
1717
warn "Missing ENV['DATABASE_ADAPTER']."
1818
else
19-
warn "Invalid ENV['DATABASE_ADAPTER']: #{ENV['DATABASE_ADAPTER']}."
19+
warn "Invalid ENV['DATABASE_ADAPTER']: #{ENV.fetch('DATABASE_ADAPTER', nil)}."
2020
end
2121

2222
gemspec
@@ -30,7 +30,9 @@ group :development, :test do
3030
gem 'rack-test'
3131
gem 'rake'
3232
gem 'rspec'
33-
gem 'rubocop', '0.81.0'
33+
gem 'rubocop', '1.81.1'
34+
gem 'rubocop-rake'
35+
gem 'rubocop-rspec'
3436
gem 'vcr'
3537
gem 'webmock'
3638
end

Gemfile.danger

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
source 'https://rubygems.org'
2+
3+
group :test do
4+
gem 'danger-toc', '~> 0.2.0', require: false
5+
gem 'slack-ruby-danger', '~> 0.2.0', require: false
6+
end

0 commit comments

Comments
 (0)