Skip to content

Commit e7d3519

Browse files
authored
Merge pull request #28 from ruby-grape/gha
Replaced Travis-CI with GHA.
2 parents 7d54307 + c23983d commit e7d3519

29 files changed

Lines changed: 260 additions & 169 deletions

.github/FUNDING.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github: [dblock]
2+
tidelift: rubygems/grape

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"

.github/workflows/danger.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: danger
2+
on: pull_request
3+
jobs:
4+
danger:
5+
name: Dangerfile
6+
runs-on: ubuntu-latest
7+
env:
8+
BUNDLE_GEMFILE: ${{ github.workspace }}/Gemfile.danger
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v4
12+
with:
13+
fetch-depth: 0
14+
- name: Set up Ruby
15+
uses: ruby/setup-ruby@v1
16+
with:
17+
ruby-version: '3.4'
18+
bundler-cache: true
19+
- run: |
20+
# the token is public, has public_repo scope and belongs to the grape-bot user owned by @dblock, this is ok
21+
TOKEN=$(echo -n Z2hwX2lYb0dPNXNyejYzOFJyaTV3QUxUdkNiS1dtblFwZTFuRXpmMwo= | base64 --decode)
22+
DANGER_GITHUB_API_TOKEN=$TOKEN bundle exec danger --verbose

.github/workflows/lint.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: lint
2+
on: [push, pull_request]
3+
jobs:
4+
rubocop:
5+
name: RuboCop
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Checkout
9+
uses: actions/checkout@v4
10+
- name: Set up Ruby
11+
uses: ruby/setup-ruby@v1
12+
with:
13+
ruby-version: '3.4'
14+
bundler-cache: true
15+
- run: bundle exec rubocop
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: test-activerecord
3+
on: [push, pull_request]
4+
jobs:
5+
test:
6+
runs-on: ubuntu-latest
7+
strategy:
8+
matrix:
9+
entry:
10+
- { ruby: '3.4', postgresql: '17', activerecord: '~> 8.0.2', grape: '2.4.0' }
11+
name: test (ruby=${{ matrix.entry.ruby }}, postgresql=${{ matrix.entry.postgresql }}, activerecord=${{ matrix.entry.activerecord }}, grape=${{ matrix.entry.grape }})
12+
env:
13+
ACTIVERECORD_VERSION: ${{ matrix.entry.activerecord }}
14+
GRAPE_VERSION: ${{ matrix.entry.grape }}
15+
steps:
16+
- uses: harmon758/postgresql-action@v1
17+
with:
18+
postgresql version: ${{ matrix.entry.postgresql }}
19+
postgresql db: slack_ruby_bot_server_test
20+
postgresql user: test
21+
postgresql password: password
22+
- uses: actions/checkout@v2
23+
- uses: ruby/setup-ruby@v1
24+
with:
25+
ruby-version: ${{ matrix.entry.ruby }}
26+
bundler-cache: true
27+
- name: Run ActiveRecord Tests
28+
env:
29+
SPEC_OPTS: --tag activerecord
30+
run: bundle exec rake
31+
- name: Run Tests
32+
run: bundle exec rake

.github/workflows/test-mongodb.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
name: test-mongodb
3+
on: [push, pull_request]
4+
jobs:
5+
test:
6+
runs-on: ubuntu-latest
7+
strategy:
8+
matrix:
9+
entry:
10+
- { ruby: '3.4', mongoid: '6.4.8', mongodb: '6.0', grape: '1.7.0' }
11+
name: test (ruby=${{ matrix.entry.ruby }}, mongoid=${{ matrix.entry.mongoid }}, mongodb=${{ matrix.entry.mongodb }}, grape=${{ matrix.entry.grape }})
12+
env:
13+
MONGOID_VERSION: ${{ matrix.entry.mongoid }}
14+
GRAPE_VERSION: ${{ matrix.entry.grape }}
15+
steps:
16+
- uses: actions/checkout@v2
17+
- uses: ruby/setup-ruby@v1
18+
with:
19+
ruby-version: ${{ matrix.entry.ruby }}
20+
bundler-cache: true
21+
- uses: supercharge/mongodb-github-action@1.7.0
22+
with:
23+
mongodb-version: ${{ matrix.entry.mongodb }}
24+
- name: Run Tests
25+
run: bundle exec rake
26+
- name: Run Mongoid Tagged Tests
27+
env:
28+
SPEC_OPTS: --tag mongoid
29+
run: bundle exec rake

.github/workflows/test.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
name: test
3+
on: [push, pull_request]
4+
jobs:
5+
test:
6+
runs-on: ubuntu-latest
7+
strategy:
8+
matrix:
9+
entry:
10+
- { ruby: 3.4 }
11+
name: test (ruby=${{ matrix.entry.ruby }})
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: ruby/setup-ruby@v1
15+
with:
16+
ruby-version: ${{ matrix.entry.ruby }}
17+
bundler-cache: true
18+
- name: Run Tests
19+
run: bundle exec rake

.rubocop.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
AllCops:
2-
TargetRubyVersion: 2.3
3-
DisplayCopNames: true
2+
TargetRubyVersion: 3.0
3+
NewCops: enable
44
Exclude:
55
- bin/**/*
66
- gemfiles/**/*
77
- spec/**/*
88
- vendor/**/*
99

10-
inherit_from: .rubocop_todo.yml
10+
inherit_from: .rubocop_todo.yml
11+
12+
plugins:
13+
- rubocop-rake
14+
- rubocop-rspec

.rubocop_todo.yml

Lines changed: 37 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,45 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2017-07-02 09:34:39 -0400 using RuboCop version 0.49.1.
3+
# on 2025-09-24 16:57:49 UTC using RuboCop version 1.80.2.
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: 7
10-
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
11-
# URISchemes: http, https
12-
Metrics/LineLength:
13-
Max: 108
9+
# Offense count: 1
10+
# Configuration parameters: Severity.
11+
Gemspec/RequiredRubyVersion:
12+
Exclude:
13+
- 'grape-roar.gemspec'
14+
15+
# Offense count: 1
16+
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
17+
Metrics/MethodLength:
18+
Max: 11
19+
20+
# Offense count: 1
21+
# Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, CheckDefinitionPathHierarchyRoots, Regex, IgnoreExecutableScripts, AllowedAcronyms.
22+
# CheckDefinitionPathHierarchyRoots: lib, spec, test, src
23+
# 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
24+
Naming/FileName:
25+
Exclude:
26+
- 'Rakefile.rb'
27+
- 'lib/grape-roar.rb'
28+
29+
# Offense count: 6
30+
# Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros, UseSorbetSigs.
31+
# NamePrefix: is_, has_, have_, does_
32+
# ForbiddenPrefixes: is_, has_, have_, does_
33+
# AllowedMethods: is_a?
34+
# MethodDefinitionMacros: define_method, define_singleton_method
35+
Naming/PredicatePrefix:
36+
Exclude:
37+
- 'spec/**/*'
38+
- 'lib/grape/roar/extensions/relations/validations/active_record.rb'
39+
- 'lib/grape/roar/extensions/relations/validations/mongoid.rb'
1440

1541
# Offense count: 14
42+
# Configuration parameters: AllowedConstants.
1643
Style/Documentation:
1744
Exclude:
1845
- 'spec/**/*'
@@ -32,18 +59,8 @@ Style/Documentation:
3259
- 'lib/grape/roar/representer.rb'
3360

3461
# Offense count: 1
35-
# Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts, AllowedAcronyms.
36-
# 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
37-
Style/FileName:
38-
Exclude:
39-
- 'lib/grape-roar.rb'
40-
41-
# Offense count: 3
42-
# Configuration parameters: NamePrefix, NamePrefixBlacklist, NameWhitelist.
43-
# NamePrefix: is_, has_, have_
44-
# NamePrefixBlacklist: is_, has_, have_
45-
# NameWhitelist: is_a?
46-
Style/PredicateName:
62+
# Configuration parameters: AllowedMethods.
63+
# AllowedMethods: respond_to_missing?
64+
Style/OptionalBooleanParameter:
4765
Exclude:
48-
- 'spec/**/*'
49-
- 'lib/grape/roar/extensions/relations/validations/active_record.rb'
66+
- 'lib/grape/roar/extensions/relations/dsl_methods.rb'

.travis.yml

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

0 commit comments

Comments
 (0)