-
-
Notifications
You must be signed in to change notification settings - Fork 52
152 lines (148 loc) · 4.97 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# 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:
# See https://github.com/tmm1/test-queue#environment-variables
TEST_QUEUE_WORKERS: 2
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, 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:
- name: windows misc
if: matrix.os == 'windows'
run: |
# set TMPDIR, git core.autocrlf
echo "TMPDIR=$env:RUNNER_TEMP" >> $GITHUB_ENV
git config --system core.autocrlf false
- name: checkout
uses: actions/checkout@v4
- name: set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: install dependencies
run: bundle install --jobs 3 --retry 3
- name: code coverage
if: matrix.coverage
uses: paambaati/codeclimate-action@v9.0.0
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 && matrix.internal_investigation != true"
run: bundle exec rake spec
prism:
runs-on: ubuntu-latest
name: Prism
steps:
- uses: actions/checkout@v4
- name: set up Ruby
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 }}
runs-on: ${{ matrix.os }}-latest
env:
# See https://github.com/tmm1/test-queue#environment-variables
TEST_QUEUE_WORKERS: 2
strategy:
fail-fast: false
matrix:
os: [ubuntu]
ruby: [2.7]
rubocop: [master]
internal_investigation: [null]
include:
- { rubocop: master, ruby: "3.0", os: ubuntu }
- { rubocop: "v1.61.0", ruby: "3.3", os: ubuntu }
steps:
- name: checkout
uses: actions/checkout@v4
- name: set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: setup env
run: echo 'RUBOCOP_VERSION=${{ matrix.rubocop }}' >> $GITHUB_ENV
- name: install rubocop from source for full specs
run: git clone --branch ${{ matrix.rubocop }} 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 | ${{ matrix.ruby }}
runs-on: ${{ matrix.os }}-latest
env:
# See https://github.com/tmm1/test-queue#environment-variables
TEST_QUEUE_WORKERS: 2
RUBOCOP_VERSION: master
strategy:
fail-fast: false
matrix:
os: [ubuntu]
ruby: ["3.0"]
rubocop: [master]
steps:
- name: checkout
uses: actions/checkout@v4
- name: set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: install dependencies
run: bundle install --jobs 3 --retry 3
- name: internal investigation
run: bundle exec rake generate internal_investigation