-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathconfig.yml
More file actions
361 lines (360 loc) · 10.7 KB
/
config.yml
File metadata and controls
361 lines (360 loc) · 10.7 KB
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
version: 2.1
library_gemfile: &library_gemfile
gemfile:
- "./gemfiles/aws_30.gemfile"
- "./gemfiles/aws_60.gemfile"
- "./gemfiles/cuba_30.gemfile"
- "./gemfiles/cuba_40.gemfile"
- "./gemfiles/dalli_20.gemfile"
- "./gemfiles/dalli_30.gemfile"
- "./gemfiles/dalli_32.gemfile"
- "./gemfiles/excon_079.gemfile"
- "./gemfiles/excon_0100.gemfile"
- "./gemfiles/excon_100.gemfile"
- "./gemfiles/graphql_10.gemfile"
- "./gemfiles/graphql_20.gemfile"
- "./gemfiles/grpc_10.gemfile"
- "./gemfiles/net_http_01.gemfile"
- "./gemfiles/rack_20.gemfile"
- "./gemfiles/rack_30.gemfile"
- "./gemfiles/redis_40.gemfile"
- "./gemfiles/redis_50.gemfile"
- "./gemfiles/rest_client_20.gemfile"
- "./gemfiles/resque_122.gemfile"
- "./gemfiles/resque_20.gemfile"
- "./gemfiles/roda_20.gemfile"
- "./gemfiles/roda_30.gemfile"
- "./gemfiles/sidekiq_60.gemfile"
- "./gemfiles/sidekiq_65.gemfile"
- "./gemfiles/sidekiq_70.gemfile"
- "./gemfiles/sinatra_22.gemfile"
- "./gemfiles/sinatra_30.gemfile"
- "./gemfiles/sinatra_40.gemfile"
- "./gemfiles/shoryuken_50.gemfile"
- "./gemfiles/shoryuken_60.gemfile"
- "./gemfiles/mongo_216.gemfile"
- "./gemfiles/mongo_219.gemfile"
executors:
ruby_33_lint:
docker:
- image: public.ecr.aws/docker/library/ruby:3.4
base:
parameters:
ruby_version:
type: string
default: "3.1"
docker:
- image: public.ecr.aws/docker/library/ruby:<<parameters.ruby_version>>
environment:
MEMCACHED_HOST: '127.0.0.1:11211'
REDIS_URL: 'redis://127.0.0.1:6379'
DATABASE_URL: 'sqlite3::memory:'
- image: public.ecr.aws/docker/library/memcached
- image: public.ecr.aws/docker/library/redis
- image: public.ecr.aws/aws-dynamodb-local/aws-dynamodb-local
- image: quay.io/minio/minio
command: ["server", "/data"]
- image: public.ecr.aws/redbox-public/s12v/sns:latest
- image: public.ecr.aws/sprig/elasticmq-native
- image: public.ecr.aws/docker/library/mongo:5-focal
mysql2:
parameters:
ruby_version:
type: string
default: "3.1"
docker:
- image: public.ecr.aws/docker/library/ruby:<<parameters.ruby_version>>
environment:
DATABASE_URL: "mysql2://root@127.0.0.1:3306/ci_test"
- image: public.ecr.aws/docker/library/mariadb
environment:
MYSQL_DATABASE: 'ci_test'
MYSQL_USER: 'root'
MYSQL_PASSWORD: ''
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
MYSQL_ROOT_PASSWORD: ''
MYSQL_ROOT_HOST: '%'
postgres:
parameters:
ruby_version:
type: string
default: "3.1"
docker:
- image: public.ecr.aws/docker/library/ruby:<<parameters.ruby_version>>
environment:
DATABASE_URL: "postgres://postgres:test@127.0.0.1:5432/ci_test"
- image: public.ecr.aws/docker/library/postgres
environment:
POSTGRES_PASSWORD: 'test'
POSTGRES_DB: 'ci_test'
commands:
setup:
steps:
- run:
name: Update RubyGems
command: |
gem update --system
gem --version
- run:
name: Install Bundler
command: |
gem install bundler
bundler --version
bundle config set path './vendor/bundle'
- run:
name: Install Dependencies
command: |
bundle check || bundle install
run_sonarqube:
steps:
- run:
name: Install Java for the SonarQube tool
command: |
sudo apt-get update
sudo apt-get install openjdk-11-jdk
- run:
name: Install dependencies for coverage merge
command: |
bundler --version
bundle config set path './vendor/bundle'
bundle check || bundle install
environment:
BUNDLE_GEMFILE: './Gemfile'
- run:
name: Fetching partial coverage reports from workflow jobs
command: |
./download.sh
- run:
name: Merging partial coverage reports for reporting
command: |
bundle exec rake coverage:merge_reports --trace
environment:
BUNDLE_GEMFILE: './Gemfile'
- run:
name: Run SonarQube to report the coverage
command: |
wget -O /tmp/sonar-scanner-cli.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.8.1.3023.zip
unzip -d /tmp /tmp/sonar-scanner-cli.zip
if [[ -n "${CIRCLE_PR_NUMBER}" ]]; then
/tmp/sonar-scanner-4.8.1.3023/bin/sonar-scanner \
-Dsonar.host.url="${SONARQUBE_URL}" \
-Dsonar.login="${SONARQUBE_LOGIN}" \
-Dsonar.pullrequest.key="${CIRCLE_PR_NUMBER}" \
-Dsonar.pullrequest.branch="${CIRCLE_BRANCH}"
else
/tmp/sonar-scanner-4.8.1.3023/bin/sonar-scanner \
-Dsonar.host.url="${SONARQUBE_URL}" \
-Dsonar.login="${SONARQUBE_LOGIN}" \
-Dsonar.branch.name="${CIRCLE_BRANCH}"
fi
- store_artifacts:
path: partial_coverage_results
- store_artifacts:
path: coverage
run_tests:
steps:
- run:
name: Run Tests
command: |
mkdir _junit
bundle exec rake
- store_test_results:
path: ~/project/_junit
- store_artifacts:
path: coverage
run_rubocop:
steps:
- run:
name: Run Tests
command: |
bundle exec rubocop
publish_gem:
steps:
- run:
name: Setup Access
command: |
mkdir -p ~/.gem
echo -e "---\r\n:rubygems_api_key: $RUBYGEMS_API_KEY" > ~/.gem/credentials
chmod 0600 /home/circleci/.gem/credentials
- run:
name: Publish Gem
command: |
bundle exec rake release[origin]
jobs:
test_core:
parameters:
stack:
type: string
default: "base"
ruby_version:
type: string
default: "3.1"
executor:
name: <<parameters.stack>>
ruby_version: <<parameters.ruby_version>>
steps:
- checkout
- setup
- run_tests
test_apprisal:
parameters:
stack:
type: string
default: "base"
gemfile:
type: string
default: "./gemfiles/aws_30.gemfile"
ruby_version:
type: string
default: "3.1"
executor:
name: <<parameters.stack>>
ruby_version: <<parameters.ruby_version>>
environment:
APPRAISAL_INITIALIZED: "1"
BUNDLE_GEMFILE: << parameters.gemfile >>
steps:
- checkout
- setup
- run_tests
lint:
executor: ruby_33_lint
environment:
BUNDLE_GEMFILE: "./gemfiles/rubocop_162.gemfile"
steps:
- checkout
- run:
name: Install Dependencies
command: |
bundle check || bundle install
- run_rubocop
report_coverage:
executor: base
steps:
- checkout
# - run_sonarqube
publish:
executor:
name: "base"
ruby_version: "3.4"
steps:
- checkout
- setup
- publish_gem
workflows:
publish:
jobs:
- publish:
filters:
branches:
ignore: /.*/
tags:
only: /^v.*/
core:
jobs:
- lint
- test_core:
name: "test_core-ruby-<<matrix.stack>>-<<matrix.ruby_version>>"
matrix:
parameters:
stack:
- base
ruby_version:
- "3.1"
- "3.2"
- "3.3"
- "3.4"
- "3.5.0-preview1"
libraries_ruby_31_32:
jobs:
- test_apprisal:
name: "test_apprisal-<<matrix.gemfile>>-ruby-<<matrix.stack>>-<<matrix.ruby_version>>"
matrix:
parameters:
stack:
- base
<<: *library_gemfile
ruby_version:
- "3.1"
- "3.2"
libraries_ruby_33_35:
jobs:
- test_apprisal:
name: "test_apprisal-<<matrix.gemfile>>-ruby-<<matrix.stack>>-<<matrix.ruby_version>>"
matrix:
parameters:
stack:
- base
<<: *library_gemfile
ruby_version:
- "3.3"
- "3.4"
- "3.5.0-preview1"
# Currently compiling the native extensions for `grpc`
# exceeds an internal RAM and/or CPU limit of CircleCI executor,
# and the job gets terminated with:
# `Received "killed" signal`
# Hence we exclude it here for the time being.
# TODO: Remove this exclusion as soon as pre-built binaries are available
# on https://rubygems.org/gems/grpc/versions
exclude:
- stack: base
ruby_version: "3.5.0-preview1"
gemfile: "./gemfiles/grpc_10.gemfile"
rails_ruby_31_35:
jobs:
- test_apprisal:
name: "test_apprisal-rails-<<matrix.gemfile>>-ruby-<<matrix.stack>>-<<matrix.ruby_version>>"
matrix:
parameters:
stack:
- base
- mysql2
- postgres
gemfile:
- "./gemfiles/rails_61.gemfile"
- "./gemfiles/rails_70.gemfile"
- "./gemfiles/rails_71.gemfile"
ruby_version:
- "3.1"
- "3.2"
- "3.3"
- "3.4"
- "3.5.0-preview1"
rails8_ruby_33_35:
jobs:
- test_apprisal:
name: "test_apprisal-rails-8-<<matrix.gemfile>>-ruby-<<matrix.stack>>-<<matrix.ruby_version>>"
matrix:
parameters:
stack:
- base
- mysql2
- postgres
gemfile:
- "./gemfiles/rails_80.gemfile"
ruby_version:
- "3.2"
- "3.3"
- "3.4"
sequel:
jobs:
- test_apprisal:
name: "test_apprisal-sequel-<<matrix.gemfile>>-ruby-<<matrix.stack>>-<<matrix.ruby_version>>"
matrix:
parameters:
stack:
- base
- mysql2
gemfile:
- "./gemfiles/sequel_56.gemfile"
- "./gemfiles/sequel_57.gemfile"
- "./gemfiles/sequel_58.gemfile"
ruby_version:
- "3.1"
- "3.2"
- "3.3"
- "3.5.0-preview1"
report_coverage:
jobs:
- report_coverage