-
-
Notifications
You must be signed in to change notification settings - Fork 55
128 lines (121 loc) · 4.27 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# CAUTION: There's probably a way to refactor this nicely. PR welcome.
# NOTE: Reflect changes in .mergify.yml
# NOTE: When changing minimal version of Ruby or Rubocop, change all of them
name: CI
on:
push:
branches:
- master
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
ast_specs:
name: >-
${{ matrix.title || 'Specs' }} | ${{ matrix.ruby }}
runs-on: ${{ matrix.os }}-latest
timeout-minutes: 5
env:
RUBOCOP_VERSION: none
JRUBY_OPTS: --dev # http://blog.headius.com/2019/09/jruby-startup-time-exploration.html
TRUFFLERUBYOPT: --engine.Mode=latency # optimize for short test suites
strategy:
fail-fast: false
matrix:
os: [ubuntu]
ruby: [2.7, "3.0", 3.1, 3.2, 3.3, 3.4, head]
coverage: [null]
modern: [null]
title: [null]
include:
- { ruby: 2.7, os: ubuntu, coverage: true, title: "Coverage" }
- { ruby: "3.0", os: ubuntu, modern: true, title: 'Specs "modern"' }
- { ruby: jruby, os: ubuntu }
- { ruby: jruby-head, os: ubuntu }
- { ruby: truffleruby, os: ubuntu }
- { ruby: truffleruby-head, os: ubuntu }
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: code coverage
if: matrix.coverage
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: "758a8228862932dc8afa9144c4a5bc5dfe29c2f7dde1b7734175bad49ee310e7"
COVERAGE: "true"
with:
coverageCommand: bundle exec rake spec
debug: true
- name: set modernize mode
if: matrix.modern == true
run: echo 'MODERNIZE=true' >> $GITHUB_ENV
- name: independence check
if: matrix.os != 'windows'
run: (! bundle exec rubocop -h 2> /dev/null) && echo 'RuboCop successfully *not* loaded for local tests'
- name: spec
if: "matrix.coverage != true"
run: bundle exec rake spec
prism:
runs-on: ubuntu-latest
name: Prism
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
# Specify the minimum Ruby version 2.7 required for Prism to run.
ruby-version: 2.7
bundler-cache: true
- name: spec
env:
PARSER_ENGINE: parser_prism
run: bundle exec rake prism_spec
rubocop_specs:
name: >-
Main Gem Specs | RuboCop: ${{ matrix.rubocop }} | ${{ matrix.ruby }} | ${{ matrix.parser_engine }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# Instead of testing all possibilities, we test the extreme points of
# a diagonal with the shiniest and latest
ruby: ["2.7", "3.4"]
rubocop: [master]
parser_engine: [parser_whitequark]
include:
# as well as very old specs & ancient ruby version
- { rubocop: "v1.61.0", parser_engine: parser_whitequark, ruby: "2.7" }
# also test against the prism parser translator
- { rubocop: "master", parser_engine: parser_prism, ruby: "3.4" }
env:
RUBOCOP_VERSION: ${{ matrix.rubocop }}
PARSER_ENGINE: ${{ matrix.parser_engine }}
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: install rubocop from source for full specs
run: git clone --branch $RUBOCOP_VERSION https://github.com/rubocop/rubocop.git ../rubocop
- name: install rubocop dependencies
run: cd ../rubocop && bundle install --jobs 3 --retry 3
- name: install dependencies
run: bundle install --jobs 3 --retry 3
- name: generate lexer and parser
run: bundle exec rake generate
- name: spec
run: cd ../rubocop && bundle exec rake spec
internal_investigation:
name: Coding Style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ruby # Latest stable CRuby version
bundler-cache: true
- name: internal investigation
run: bundle exec rake generate internal_investigation