forked from rubocop/rubocop
-
Notifications
You must be signed in to change notification settings - Fork 0
173 lines (157 loc) · 5.03 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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
name: CI
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
permissions: # added using https://github.com/step-security/secure-workflows
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
spec-ubuntu:
name: Spec - ubuntu ${{ matrix.ruby }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby: ['2.7', '3.0', '3.1', '3.2', '3.3', 'head']
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Check requiring libraries successfully
# See https://github.com/rubocop/rubocop/pull/4523#issuecomment-309136113
run: ruby -I lib -r bundler/setup -r rubocop -e 'exit 0'
- name: spec
env:
CI_RUBY_VERSION: ${{ matrix.ruby }}
CC_TEST_REPORTER_ID: dummy # Value doesn't matter, enables json formatter
run: COVERAGE=true bundle exec rake spec
- name: Upload Coverage Artifact
uses: actions/upload-artifact@v4
with:
name: coverage-ubuntu-${{ matrix.ruby }}
path: coverage/coverage.json
if-no-files-found: error
spec-jruby:
name: Spec - JRuby
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: 'jruby' # Latest stable JRuby version
bundler-cache: true
- name: spec
run: bundle exec rake spec
spec-windows:
needs: spec-ubuntu # Don't spend CI resources on slow Windows specs if CI won't pass anyway.
name: Spec - windows ${{ matrix.ruby }}
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
ruby:
- '2.7' # Oldest supported version
- 'ruby' # Latest stable CRuby version
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Check requiring libraries successfully
# See https://github.com/rubocop/rubocop/pull/4523#issuecomment-309136113
run: ruby -I lib -r bundler/setup -r rubocop -e 'exit 0'
- name: spec
env:
CI_RUBY_VERSION: ${{ matrix.ruby }}
run: bundle exec rake spec
upload_coverage:
name: Upload Coverage
needs: spec-ubuntu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
name: Download Coverage Artifacts
with:
pattern: coverage-*
- uses: paambaati/codeclimate-action@v9
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
if: ${{ env.CC_TEST_REPORTER_ID != '' }}
with:
coverageLocations: |
${{github.workspace}}/coverage-*/coverage.json:simplecov
ascii_spec:
name: Ascii Spec - ${{ matrix.os }} ${{ matrix.ruby }}
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu, windows]
ruby:
- '2.7' # Oldest supported version
- 'ruby' # Latest stable CRuby version
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: ascii_spec
env:
CI_RUBY_VERSION: ${{ matrix.ruby }}
run: bundle exec rake ascii_spec
documentation_check:
name: Documentation Check
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: Check documentation syntax
run: bundle exec rake documentation_syntax_check
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
rspec4:
runs-on: ubuntu-latest
name: RSpec 4
steps:
- uses: actions/checkout@v4
- name: Use latest RSpec 4 from `4-0-dev` branch
run: |
sed -e "/'rspec', '~> 3/d" -i Gemfile
cat << EOF > Gemfile.local
gem 'rspec', github: 'rspec/rspec-metagem', branch: '4-0-dev'
gem 'rspec-core', github: 'rspec/rspec-core', branch: '4-0-dev'
gem 'rspec-expectations', github: 'rspec/rspec-expectations', branch: '4-0-dev'
gem 'rspec-mocks', github: 'rspec/rspec-mocks', branch: '4-0-dev'
gem 'rspec-support', github: 'rspec/rspec-support', branch: '4-0-dev'
EOF
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: true
- name: spec
run: bundle exec rake spec