-
Notifications
You must be signed in to change notification settings - Fork 2
/
ruby.yml
118 lines (109 loc) · 2.29 KB
/
ruby.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
spec:
inputs:
platform:
description: 'The Ruby platform to use'
type: string
options:
- 'ruby'
- 'jruby'
default: 'ruby'
---
include:
- remote: https://github.com/elct9620/ruby-gitlab-ci/raw/main/common.yml#ruby.yml
inputs:
platform: $[[ inputs.platform ]]
variables:
RUBY_VERSION: 3.2.2
CUCUMBER_PUBLISH_QUIET: 'true'
rubygems:
extends: .ruby
stage: prepare
script:
- bundle install
retry:
max: 1
interruptible: true
cache:
- key: !reference [.ruby-cache, key]
paths: !reference [.ruby-cache, paths]
policy: pull-push
rubocop:
extends: .ruby
stage: lint
needs: ["rubygems"]
script:
- bundle exec rubocop
interruptible: true
rules:
- exists:
- .rubocop.yml
sorbet:
extends: .ruby
stage: lint
needs: ["rubygems"]
script:
- bundle exec srb tc
interruptible: true
rules:
- if: '$SORBET_ENABLED == "yes"'
exists:
- sorbet/config
bundler-audit:
extends: .ruby
stage: lint
needs: ["rubygems"]
before_script:
- gem install bundler-audit
- bundle audit --update
script:
- bundle audit
interruptible: true
bundler-leak:
extends: .ruby
stage: lint
needs: ["rubygems"]
before_script:
- gem install bundler-leak
- bundle leak check --update
script:
- bundle leak
interruptible: true
rspec:
extends: .ruby
stage: test
needs: ["rubygems"]
script:
- if [[ "$RSPEC_JUNIT_REPORT" == "yes" ]]; then bundle exec rspec --format progress --format RspecJunitFormatter --out rspec.xml; else bundle exec rspec; fi
interruptible: true
artifacts:
paths:
- coverage
- rspec.xml
reports:
junit: rspec.xml
coverage_report:
coverage_format: cobertura
path: coverage/coverage.xml
coverage: '/\(\d+.\d+%\)/'
rules:
- exists:
- spec/spec_helper.rb
cucumber:
extends: .ruby
stage: test
needs: ["rubygems"]
script:
- bundle exec cucumber -f junit,fileattribute=true -o tmp/cucumber
interruptible: true
artifacts:
paths:
- coverage
reports:
junit: tmp/cucumber/**/TEST-*.xml
coverage_report:
coverage_format: cobertura
path: coverage/coverage.xml
coverage: '/\(\d+.\d+%\)/'
rules:
- exists:
- features/support/env.rb