Skip to content

Commit 53175c5

Browse files
chore(*): setup Github actions for linting
1 parent 2b8cf82 commit 53175c5

File tree

6 files changed

+98
-11
lines changed

6 files changed

+98
-11
lines changed

.github/workflows/lint.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: lint
2+
on:
3+
pull_request:
4+
branches:
5+
- master
6+
jobs:
7+
danger:
8+
runs-on: ubuntu-latest
9+
env:
10+
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
- name: Ruby setup
15+
uses: actions/setup-ruby@v1
16+
with:
17+
ruby-version: 2.7
18+
- name: Bundle installation
19+
run: |
20+
gem install bundler:2.1.2
21+
bundle install
22+
- name: Rubocop
23+
run: |
24+
bundle exec danger --fail-on-errors=true

.github/workflows/test.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,18 @@ jobs:
1010
rspec:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- name: Check out
13+
- name: Checkout
1414
uses: actions/checkout@v2
15-
- name: Set up Ruby 2.7
15+
- name: Ruby setup
1616
uses: actions/setup-ruby@v1
1717
with:
1818
ruby-version: 2.7
19-
- name: Testing with RSpec
19+
- name: Bundle installation
2020
run: |
2121
gem install bundler:2.1.2
22-
bundle install --with development test
22+
bundle install
23+
- name: RSpec
24+
run: |
2325
bundle exec rspec
2426
2527
integration_test:
@@ -28,10 +30,12 @@ jobs:
2830
matrix:
2931
mode: [flag-off, flag-on, prebuild-changes, prebuild-all]
3032
steps:
31-
- name: Check out
33+
- name: Checkout
3234
uses: actions/checkout@v2
33-
- name: Running integration tests
35+
- name: Bundle installation
3436
run: |
3537
gem install bundler:2.1.2
3638
bundle install
39+
- name: Integration tests
40+
run: |
3741
sh scripts/integration_test.sh ${{ matrix.mode }}

.rubocop.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,8 @@ Metrics/CyclomaticComplexity:
9393

9494
Metrics/BlockLength:
9595
Enabled: false
96+
97+
Naming/FileName:
98+
Exclude:
99+
- Gemfile
100+
- Dangerfile

Dangerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
rubocop.lint(
2+
force_exclusion: true,
3+
inline_comment: true,
4+
only_report_new_offenses: true,
5+
include_cop_names: true
6+
)

Gemfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,13 @@ end
1313

1414
group :test do
1515
gem "rspec"
16-
end
17-
18-
group :integration_test do
1916
gem "xcpretty"
2017
end
2118

2219
group :lint do
23-
gem "rubocop"
20+
gem "danger"
21+
gem "danger-rubocop"
22+
gem "rubocop", "0.84.0"
2423
end
2524

2625
group :debug do

Gemfile.lock

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,16 @@ GEM
1616
minitest (~> 5.1)
1717
thread_safe (~> 0.3, >= 0.3.4)
1818
tzinfo (~> 1.1)
19+
addressable (2.7.0)
20+
public_suffix (>= 2.0.2, < 5.0)
1921
ast (2.4.0)
2022
atomos (0.1.3)
2123
bacon (1.2.0)
2224
claide (1.0.3)
25+
claide-plugins (0.9.2)
26+
cork
27+
nap
28+
open4 (~> 1.3)
2329
cocoapods (1.7.5)
2430
activesupport (>= 4.0.2, < 5)
2531
claide (>= 1.0.2, < 2.0)
@@ -56,24 +62,58 @@ GEM
5662
coderay (1.1.3)
5763
colored2 (3.1.2)
5864
concurrent-ruby (1.1.6)
65+
cork (0.3.0)
66+
colored2 (~> 3.1)
67+
danger (8.0.5)
68+
claide (~> 1.0)
69+
claide-plugins (>= 0.9.2)
70+
colored2 (~> 3.1)
71+
cork (~> 0.1)
72+
faraday (>= 0.9.0, < 2.0)
73+
faraday-http-cache (~> 2.0)
74+
git (~> 1.7)
75+
kramdown (~> 2.3)
76+
kramdown-parser-gfm (~> 1.0)
77+
no_proxy_fix
78+
octokit (~> 4.7)
79+
terminal-table (~> 1)
80+
danger-rubocop (0.9.0)
81+
danger
82+
rubocop (~> 0.83)
5983
diff-lcs (1.3)
6084
escape (0.0.4)
85+
faraday (1.0.1)
86+
multipart-post (>= 1.2, < 3)
87+
faraday-http-cache (2.2.0)
88+
faraday (>= 0.8)
6189
fourflusher (2.3.1)
6290
fuzzy_match (2.0.4)
6391
gh_inspector (1.1.3)
92+
git (1.7.0)
93+
rchardet (~> 1.8)
6494
i18n (0.9.5)
6595
concurrent-ruby (~> 1.0)
6696
interception (0.5)
97+
kramdown (2.3.0)
98+
rexml
99+
kramdown-parser-gfm (1.1.0)
100+
kramdown (~> 2.0)
67101
lazy_priority_queue (0.1.1)
68102
method_source (0.9.2)
69103
minitest (5.14.0)
70104
mocha (1.10.2)
71105
mocha-on-bacon (0.2.3)
72106
mocha (>= 0.13.0)
73107
molinillo (0.6.6)
108+
multipart-post (2.1.1)
74109
nanaimo (0.2.6)
75110
nap (1.1.0)
76111
netrc (0.11.0)
112+
no_proxy_fix (0.1.2)
113+
octokit (4.18.0)
114+
faraday (>= 0.9)
115+
sawyer (~> 0.8.0, >= 0.5.3)
116+
open4 (1.3.4)
77117
parallel (1.19.1)
78118
parser (2.7.1.3)
79119
ast (~> 2.4.0)
@@ -87,8 +127,10 @@ GEM
87127
pry-rescue (1.5.1)
88128
interception (>= 0.5)
89129
pry (>= 0.12.0)
130+
public_suffix (4.0.6)
90131
rainbow (3.0.0)
91132
rake (10.5.0)
133+
rchardet (1.8.0)
92134
rexml (3.2.4)
93135
rgl (0.5.6)
94136
lazy_priority_queue (~> 0.1.0)
@@ -119,7 +161,12 @@ GEM
119161
parser (>= 2.7.0.1)
120162
ruby-macho (1.4.0)
121163
ruby-progressbar (1.10.1)
164+
sawyer (0.8.2)
165+
addressable (>= 2.3.5)
166+
faraday (> 0.8, < 2.0)
122167
stream (0.5.2)
168+
terminal-table (1.8.0)
169+
unicode-display_width (~> 1.1, >= 1.1.1)
123170
thread_safe (0.3.6)
124171
tzinfo (1.2.7)
125172
thread_safe (~> 0.1)
@@ -141,6 +188,8 @@ DEPENDENCIES
141188
bundler (>= 1.3)
142189
cocoapods
143190
cocoapods-binary-cache!
191+
danger
192+
danger-rubocop
144193
mocha
145194
mocha-on-bacon
146195
prettybacon
@@ -149,7 +198,7 @@ DEPENDENCIES
149198
pry-rescue
150199
rake (~> 10.0)
151200
rspec
152-
rubocop
201+
rubocop (= 0.84.0)
153202
xcpretty
154203

155204
BUNDLED WITH

0 commit comments

Comments
 (0)