9
9
only_branch_master_parent_repo : &only_branch_master_parent_repo
10
10
- ' master@saltstack-formulas/syslog-ng-formula'
11
11
# `stage`
12
+ stage_cache : &stage_cache 'cache'
12
13
stage_lint : &stage_lint 'lint'
13
14
stage_release : &stage_release 'release'
14
15
stage_test : &stage_test 'test'
15
16
# `image`
16
- image_commitlint : &image_commitlint 'myii/ssf-commitlint:11'
17
- image_dindruby : &image_dindruby 'myii/ssf-dind-ruby:2.7.1-r3 '
18
- image_precommit : &image_precommit
19
- name : ' myii/ssf-pre-commit:2.9.2 '
20
- entrypoint : ['/bin/bash', '-c']
21
- image_rubocop : &image_rubocop 'pipelinecomponents/rubocop:latest'
22
- image_semantic-release : &image_semanticrelease 'myii/ssf-semantic-release:15.14'
17
+ # yamllint disable rule:line-length
18
+ image_commitlint : &image_commitlint 'techneg/ci-commitlint:v1.1.91@sha256:02574d0409adafb76d5a40a7d08202073e5377f4a7c4bfe9e198d1203ff94a8c '
19
+ image_dindruby : &image_dindruby 'techneg/ci-docker-python-ruby:v2.2.60@sha256:de98b8d1d3cf86639fe69bfc4f0416115d18300759c5ed2948ac56f973dd944f'
20
+ image_dindrubybionic : &image_dindrubybionic 'techneg/ci-docker-python-ruby:v2.2.60@sha256:de98b8d1d3cf86639fe69bfc4f0416115d18300759c5ed2948ac56f973dd944f '
21
+ image_precommit : &image_precommit 'techneg/ci-pre-commit:v2.4.25@sha256:ff5192e893c1079fbf70e3ce6bfc3773815041786a75659793158be930ba7803'
22
+ image_rubocop : &image_rubocop 'pipelinecomponents/rubocop:latest@sha256:fe69f9642c7edde46bbd78326d2c42c6e13fc73694efb142e92e206725479328 '
23
+ image_semantic-release : &image_semanticrelease 'myii/ssf-semantic-release:15.14@sha256:374f588420087517a3cc0235e11293bffd72d7a59da3d98d5e69f014ff2a7761 '
23
24
# `services`
24
25
services_docker_dind : &services_docker_dind
25
- - ' docker:dind'
26
+ - ' docker:28.2.2-dind@sha256:d4668861cabc1691635d98e827a81cfa834a416f8fe0f4efc609f9f806d86d82'
27
+ # yamllint enable rule:line-length
26
28
# `variables`
27
29
# https://forum.gitlab.com/t/gitlab-com-ci-caching-rubygems/5627/3
28
- # https://bundler.io/v1.16/bundle_config .html
30
+ # https://bundler.io/v2.3/man/bundle-config.1 .html
29
31
variables_bundler : &variables_bundler
30
- BUNDLE_CACHE_PATH : ' ${CI_PROJECT_DIR}/.cache/bundler'
31
- BUNDLE_WITHOUT : ' production'
32
- # `cache`
32
+ BUNDLE_PATH : ' ${CI_PROJECT_DIR}/.cache/bundler'
33
+ BUNDLE_DEPLOYMENT : ' true'
34
+ bundle_install : &bundle_install
35
+ - ' bundle version'
36
+ - ' bundle config list'
37
+ # `--no-cache` means don't bother caching the downloaded .gem files
38
+ - ' time bundle install --no-cache'
33
39
cache_bundler : &cache_bundler
34
- key : ' ${CI_JOB_STAGE}'
40
+ key :
41
+ files :
42
+ - ' Gemfile.lock'
43
+ prefix : ' bundler'
35
44
paths :
36
- - ' ${BUNDLE_CACHE_PATH}'
45
+ - ' ${BUNDLE_PATH}'
46
+ # https://pre-commit.com/#gitlab-ci-example
47
+ variables_pre-commit : &variables_pre-commit
48
+ PRE_COMMIT_HOME : ' ${CI_PROJECT_DIR}/.cache/pre-commit'
49
+ cache_pre-commit : &cache_pre-commit
50
+ key :
51
+ files :
52
+ - ' .pre-commit-config.yaml'
53
+ prefix : ' pre-commit'
54
+ paths :
55
+ - ' ${PRE_COMMIT_HOME}'
37
56
38
57
# ##############################################################################
39
58
# Define stages and global variables
40
59
# ##############################################################################
41
60
stages :
61
+ - *stage_cache
42
62
- *stage_lint
43
63
- *stage_test
44
64
- *stage_release
45
65
variables :
46
66
DOCKER_DRIVER : ' overlay2'
47
67
68
+
69
+ # ##############################################################################
70
+ # `cache` stage: build up the bundler cache required before the `test` stage
71
+ # ##############################################################################
72
+ build-cache :
73
+ stage : *stage_cache
74
+ image : *image_dindruby
75
+ variables : *variables_bundler
76
+ cache : *cache_bundler
77
+ script : *bundle_install
78
+
48
79
# ##############################################################################
49
80
# `lint` stage: `commitlint`, `pre-commit` & `rubocop` (latest, failure allowed)
50
81
# ##############################################################################
51
- commitlint :
82
+ .lint_job :
52
83
stage : *stage_lint
84
+ needs : []
85
+
86
+ commitlint :
87
+ extends : ' .lint_job'
53
88
image : *image_commitlint
54
89
script :
55
90
# Add `upstream` remote to get access to `upstream/master`
@@ -74,17 +109,14 @@ commitlint:
74
109
--verbose'
75
110
76
111
pre-commit :
77
- stage : *stage_lint
112
+ extends : ' .lint_job '
78
113
image : *image_precommit
79
114
# https://pre-commit.com/#gitlab-ci-example
80
- variables :
81
- PRE_COMMIT_HOME : ' ${CI_PROJECT_DIR}/.cache/pre-commit'
82
- cache :
83
- key : ' ${CI_JOB_NAME}'
84
- paths :
85
- - ' ${PRE_COMMIT_HOME}'
115
+ variables : *variables_pre-commit
116
+ cache : *cache_pre-commit
86
117
script :
87
118
- ' pre-commit run --all-files --color always --verbose'
119
+ - ' pre-commit run --color always --hook-stage manual commitlint-ci'
88
120
89
121
# Use a separate job for `rubocop` other than the one potentially run by `pre-commit`
90
122
# - The `pre-commit` check will only be available for formulas that pass the default
@@ -93,8 +125,8 @@ pre-commit:
93
125
# - Furthermore, this job uses all of the latest `rubocop` features & cops,
94
126
# which will help when upgrading the `rubocop` linter used in `pre-commit`
95
127
rubocop :
128
+ extends : ' .lint_job'
96
129
allow_failure : true
97
- stage : *stage_lint
98
130
image : *image_rubocop
99
131
script :
100
132
- ' rubocop -d -P -S --enable-pending-cops'
@@ -107,12 +139,10 @@ rubocop:
107
139
image : *image_dindruby
108
140
services : *services_docker_dind
109
141
variables : *variables_bundler
110
- cache : *cache_bundler
111
- before_script :
112
- # TODO: This should work from the env vars above automatically
113
- - ' bundle config set path "${BUNDLE_CACHE_PATH}"'
114
- - ' bundle config set without "${BUNDLE_WITHOUT}"'
115
- - ' bundle install'
142
+ cache :
143
+ << : *cache_bundler
144
+ policy : ' pull'
145
+ before_script : *bundle_install
116
146
script :
117
147
# Alternative value to consider: `${CI_JOB_NAME}`
118
148
- ' bin/kitchen verify "${DOCKER_ENV_CI_JOB_NAME}"'
@@ -131,69 +161,25 @@ rubocop:
131
161
# Make sure the instances listed below match up with
132
162
# the `platforms` defined in `kitchen.yml`
133
163
# yamllint disable rule:line-length
134
- # default-debian-11-tiamat-py3: {extends: '.test_instance'}
135
- # default-debian-10-tiamat-py3: {extends: '.test_instance'}
136
- # default-debian-9-tiamat-py3: {extends: '.test_instance'}
137
- # default-ubuntu-2204-tiamat-py3: {extends: '.test_instance_failure_permitted'}
138
- # default-ubuntu-2004-tiamat-py3: {extends: '.test_instance'}
139
- # default-ubuntu-1804-tiamat-py3: {extends: '.test_instance'}
140
- # default-centos-stream8-tiamat-py3: {extends: '.test_instance_failure_permitted'}
141
- # default-centos-7-tiamat-py3: {extends: '.test_instance'}
142
- # default-amazonlinux-2-tiamat-py3: {extends: '.test_instance'}
143
- # default-oraclelinux-8-tiamat-py3: {extends: '.test_instance'}
144
- # default-oraclelinux-7-tiamat-py3: {extends: '.test_instance'}
145
- # default-almalinux-8-tiamat-py3: {extends: '.test_instance'}
146
- # default-rockylinux-8-tiamat-py3: {extends: '.test_instance'}
147
- default-debian-11-master-py3 : {extends: '.test_instance'}
148
- default-debian-10-master-py3 : {extends: '.test_instance'}
149
- default-debian-9-master-py3 : {extends: '.test_instance'}
150
- default-ubuntu-2204-master-py3 : {extends: '.test_instance_failure_permitted'}
151
- default-ubuntu-2004-master-py3 : {extends: '.test_instance'}
152
- default-ubuntu-1804-master-py3 : {extends: '.test_instance'}
153
- default-centos-stream8-master-py3 : {extends: '.test_instance_failure_permitted'}
154
- default-centos-7-master-py3 : {extends: '.test_instance'}
155
- default-fedora-36-master-py3 : {extends: '.test_instance_failure_permitted'}
156
- default-fedora-35-master-py3 : {extends: '.test_instance'}
157
- default-opensuse-leap-153-master-py3 : {extends: '.test_instance'}
158
- default-opensuse-tmbl-latest-master-py3 : {extends: '.test_instance_failure_permitted'}
159
- default-amazonlinux-2-master-py3 : {extends: '.test_instance'}
160
- default-oraclelinux-8-master-py3 : {extends: '.test_instance'}
161
- default-oraclelinux-7-master-py3 : {extends: '.test_instance'}
162
- default-arch-base-latest-master-py3 : {extends: '.test_instance'}
163
- default-gentoo-stage3-latest-master-py3 : {extends: '.test_instance'}
164
- default-gentoo-stage3-systemd-master-py3 : {extends: '.test_instance'}
165
- default-almalinux-8-master-py3 : {extends: '.test_instance'}
166
- default-rockylinux-8-master-py3 : {extends: '.test_instance'}
167
- # default-debian-11-3004-1-py3: {extends: '.test_instance'}
168
- # default-debian-10-3004-1-py3: {extends: '.test_instance'}
169
- # default-debian-9-3004-1-py3: {extends: '.test_instance'}
170
- # default-ubuntu-2204-3004-1-py3: {extends: '.test_instance_failure_permitted'}
171
- # default-ubuntu-2004-3004-1-py3: {extends: '.test_instance'}
172
- # default-ubuntu-1804-3004-1-py3: {extends: '.test_instance'}
173
- # default-centos-stream8-3004-1-py3: {extends: '.test_instance_failure_permitted'}
174
- # default-centos-7-3004-1-py3: {extends: '.test_instance'}
175
- # default-fedora-36-3004-1-py3: {extends: '.test_instance_failure_permitted'}
176
- # default-fedora-35-3004-1-py3: {extends: '.test_instance'}
177
- # default-amazonlinux-2-3004-1-py3: {extends: '.test_instance'}
178
- # default-oraclelinux-8-3004-1-py3: {extends: '.test_instance'}
179
- # default-oraclelinux-7-3004-1-py3: {extends: '.test_instance'}
180
- # default-arch-base-latest-3004-1-py3: {extends: '.test_instance'}
181
- # default-gentoo-stage3-latest-3004-1-py3: {extends: '.test_instance'}
182
- # default-gentoo-stage3-systemd-3004-1-py3: {extends: '.test_instance'}
183
- # default-almalinux-8-3004-1-py3: {extends: '.test_instance'}
184
- # default-rockylinux-8-3004-1-py3: {extends: '.test_instance'}
185
- # default-opensuse-leap-153-3004-0-py3: {extends: '.test_instance'}
186
- # default-opensuse-tmbl-latest-3004-0-py3: {extends: '.test_instance_failure_permitted'}
187
- # default-debian-10-3003-4-py3: {extends: '.test_instance'}
188
- # default-debian-9-3003-4-py3: {extends: '.test_instance'}
189
- # default-ubuntu-2004-3003-4-py3: {extends: '.test_instance'}
190
- # default-ubuntu-1804-3003-4-py3: {extends: '.test_instance'}
191
- # default-centos-stream8-3003-4-py3: {extends: '.test_instance_failure_permitted'}
192
- # default-centos-7-3003-4-py3: {extends: '.test_instance'}
193
- # default-amazonlinux-2-3003-4-py3: {extends: '.test_instance'}
194
- # default-oraclelinux-8-3003-4-py3: {extends: '.test_instance'}
195
- # default-oraclelinux-7-3003-4-py3: {extends: '.test_instance'}
196
- # default-almalinux-8-3003-4-py3: {extends: '.test_instance'}
164
+ default-debian-12-master : {extends: '.test_instance_failure_permitted'}
165
+ default-debian-11-master : {extends: '.test_instance_failure_permitted'}
166
+ default-ubuntu-2404-master : {extends: '.test_instance_failure_permitted'}
167
+ default-ubuntu-2204-master : {extends: '.test_instance_failure_permitted'}
168
+ default-opensuse-leap-156-master : {extends: '.test_instance_failure_permitted'}
169
+ default-fedora-40-master : {extends: '.test_instance_failure_permitted'}
170
+ default-debian-12-3007-4 : {extends: '.test_instance'}
171
+ default-debian-11-3007-4 : {extends: '.test_instance'}
172
+ default-ubuntu-2404-3007-4 : {extends: '.test_instance'}
173
+ default-ubuntu-2204-3007-4 : {extends: '.test_instance'}
174
+ default-opensuse-leap-156-3007-4 : {extends: '.test_instance'}
175
+ default-fedora-40-3007-4 : {extends: '.test_instance'}
176
+ default-debian-12-3006-12 : {extends: '.test_instance'}
177
+ default-debian-11-3006-12 : {extends: '.test_instance'}
178
+ default-ubuntu-2404-3006-12 : {extends: '.test_instance'}
179
+ default-ubuntu-2204-3006-12 : {extends: '.test_instance'}
180
+ default-opensuse-leap-156-3006-12 : {extends: '.test_instance'}
181
+ default-fedora-40-3006-12 : {extends: '.test_instance'}
182
+
197
183
# yamllint enable rule:line-length
198
184
199
185
# ##############################################################################
0 commit comments