-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
106 lines (96 loc) · 2.62 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
106 lines (96 loc) · 2.62 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
.cache: &cache
key:
prefix: $RUBY_VERSION
files:
- Gemfile.lock
- gitlab_quality-test_tooling.gemspec
paths:
- vendor/ruby
stages:
- check
- test
- deploy
default:
image: ${CI_REGISTRY}/gitlab-org/gitlab-build-images/debian-${DEBIAN_VERSION}-ruby-${RUBY_VERSION}
tags:
- gitlab-org
cache:
<<: *cache
policy: pull
before_script:
- bundle install
workflow:
rules: &workflow_rules
# For merge requests, create a pipeline.
- if: '$CI_MERGE_REQUEST_IID'
# For the default branch, create a pipeline (this includes on schedules, pushes, merges, etc.).
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
# For tags, create a pipeline.
- if: '$CI_COMMIT_TAG'
# When using Run pipeline button in the GitLab UI, from the project’s CI/CD > Pipelines section, create a pipeline.
- if: '$CI_PIPELINE_SOURCE == "web"'
variables:
DEBIAN_VERSION: bookworm
RUBY_VERSION: "3.2.5"
BUNDLE_PATH: "vendor"
BUNDLE_FROZEN: "true"
BUNDLE_SILENCE_ROOT_WARNING: "true"
BUNDLE_SUPPRESS_INSTALL_USING_MESSAGES: "true"
cache-gems:
stage: .pre
script:
- echo "Cached gems!"
cache:
<<: *cache
policy: pull-push
when: on_success
rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
changes:
- Gemfile.lock
- if: '$CI_MERGE_REQUEST_IID'
changes:
- Gemfile.lock
rubocop:
stage: check
needs:
- job: cache-gems
optional: true
script:
- bundle exec rubocop --color
rspec:
stage: test
needs:
- job: cache-gems
optional: true
parallel:
matrix:
- RUBY_VERSION: ['3.1.5', '3.2.5']
script:
- bundle exec rspec --force-color --format RspecJunitFormatter --out rspec.xml
coverage: /LOC \((\d{1,3}\.\d{1,2})\%\)/
artifacts:
expire_in: 7d
paths:
- coverage/
- rspec.xml
reports:
coverage_report:
coverage_format: cobertura
path: coverage/coverage.xml
junit: rspec.xml
include:
- component: ${CI_SERVER_FQDN}/components/sast/sast@~latest
- component: ${CI_SERVER_FQDN}/components/secret-detection/secret-detection@~latest
- component: ${CI_SERVER_FQDN}/gitlab-org/components/danger-review/danger-review@1.4.1
inputs:
job_image: "${CI_REGISTRY}/gitlab-org/gitlab-build-images/debian-${DEBIAN_VERSION}-ruby-${RUBY_VERSION}"
job_stage: "check"
- component: ${CI_SERVER_FQDN}/gitlab-org/components/gem-release/gem-release@~latest
- template: Security/Dependency-Scanning.gitlab-ci.yml
gemnasium-dependency_scanning:
rules: *workflow_rules
before_script: []
secret_detection:
rules: *workflow_rules
before_script: []