-
-
Notifications
You must be signed in to change notification settings - Fork 74
65 lines (59 loc) · 1.64 KB
/
rubocop.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: RuboCop
on: [pull_request]
env:
BUNDLE_ONLY: rubocop
jobs:
rubocop:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
bundler-cache: true
cache-version: rubocop-v2
- name: Run RuboCop
run: bundle exec rubocop --parallel -f progress -f html -o tmp/rubocop/report.html
- uses: actions/upload-artifact@v4
with:
name: rubocop-report
path: tmp/rubocop/report.html
rubocop-code-scanning:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
bundler-cache: true
cache-version: rubocop-v2
- name: Run RuboCop with Code Scanning
run: |
bash -c "
bundle exec rubocop --require code_scanning --format CodeScanning::SarifFormatter -o rubocop.sarif
[[ $? -ne 2 ]]
"
- name: Upload Sarif output
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: rubocop.sarif
reviewdog:
runs-on: ubuntu-latest
steps:
- uses: reviewdog/action-setup@v1
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
bundler-cache: true
cache-version: rubocop-v2
- name: Run rubocop & reviewdog
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
bundle exec rubocop --parallel | reviewdog -reporter=github-pr-review -f=rubocop -filter-mode=nofilter