Skip to content

Commit 7af9760

Browse files
committed
ci: use latest test images
1 parent 34469f9 commit 7af9760

File tree

12 files changed

+823
-899
lines changed

12 files changed

+823
-899
lines changed

.gitlab-ci.yml

Lines changed: 66 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -9,36 +9,56 @@
99
only_branch_master_parent_repo: &only_branch_master_parent_repo
1010
- 'master@saltstack-formulas/packages-formula'
1111
# `stage`
12+
stage_cache: &stage_cache 'cache'
1213
stage_lint: &stage_lint 'lint'
1314
stage_release: &stage_release 'release'
1415
stage_test: &stage_test 'test'
1516
# `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'
2324
# `services`
2425
services_docker_dind: &services_docker_dind
25-
- 'docker:dind'
26+
- 'docker:28.2.2-dind@sha256:d4668861cabc1691635d98e827a81cfa834a416f8fe0f4efc609f9f806d86d82'
27+
# yamllint enable rule:line-length
2628
# `variables`
2729
# 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
2931
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'
3339
cache_bundler: &cache_bundler
34-
key: '${CI_JOB_STAGE}'
40+
key:
41+
files:
42+
- 'Gemfile.lock'
43+
prefix: 'bundler'
3544
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}'
3756

3857
###############################################################################
3958
# Define stages and global variables
4059
###############################################################################
4160
stages:
61+
- *stage_cache
4262
- *stage_lint
4363
- *stage_test
4464
- *stage_release
@@ -48,8 +68,12 @@ variables:
4868
###############################################################################
4969
# `lint` stage: `commitlint`, `pre-commit` & `rubocop` (latest, failure allowed)
5070
###############################################################################
51-
commitlint:
71+
.lint_job:
5272
stage: *stage_lint
73+
needs: []
74+
75+
commitlint:
76+
extends: '.lint_job'
5377
image: *image_commitlint
5478
script:
5579
# Add `upstream` remote to get access to `upstream/master`
@@ -74,17 +98,14 @@ commitlint:
7498
--verbose'
7599

76100
pre-commit:
77-
stage: *stage_lint
101+
extends: '.lint_job'
78102
image: *image_precommit
79103
# 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}'
104+
variables: *variables_pre-commit
105+
cache: *cache_pre-commit
86106
script:
87107
- 'pre-commit run --all-files --color always --verbose'
108+
- 'pre-commit run --color always --hook-stage manual commitlint-ci'
88109

89110
# Use a separate job for `rubocop` other than the one potentially run by `pre-commit`
90111
# - The `pre-commit` check will only be available for formulas that pass the default
@@ -93,8 +114,8 @@ pre-commit:
93114
# - Furthermore, this job uses all of the latest `rubocop` features & cops,
94115
# which will help when upgrading the `rubocop` linter used in `pre-commit`
95116
rubocop:
117+
extends: '.lint_job'
96118
allow_failure: true
97-
stage: *stage_lint
98119
image: *image_rubocop
99120
script:
100121
- 'rubocop -d -P -S --enable-pending-cops'
@@ -107,12 +128,10 @@ rubocop:
107128
image: *image_dindruby
108129
services: *services_docker_dind
109130
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'
131+
cache:
132+
<<: *cache_bundler
133+
policy: 'pull'
134+
before_script: *bundle_install
116135
script:
117136
# Alternative value to consider: `${CI_JOB_NAME}`
118137
- 'bin/kitchen verify "${DOCKER_ENV_CI_JOB_NAME}"'
@@ -131,69 +150,24 @@ rubocop:
131150
# Make sure the instances listed below match up with
132151
# the `platforms` defined in `kitchen.yml`
133152
# yamllint disable rule:line-length
134-
# debian-debian-11-tiamat-py3: {extends: '.test_instance'}
135-
# debian-debian-10-tiamat-py3: {extends: '.test_instance'}
136-
# debian-debian-9-tiamat-py3: {extends: '.test_instance'}
137-
# ubuntu-ubuntu-2204-tiamat-py3: {extends: '.test_instance_failure_permitted'}
138-
# ubuntu-ubuntu-2004-tiamat-py3: {extends: '.test_instance'}
139-
# ubuntu-ubuntu-1804-tiamat-py3: {extends: '.test_instance'}
140-
# redhat8-centos-stream8-tiamat-py3: {extends: '.test_instance_failure_permitted'}
141-
# centos-centos-7-tiamat-py3: {extends: '.test_instance'}
142-
# amazon-amazonlinux-2-tiamat-py3: {extends: '.test_instance'}
143-
# redhat8-oraclelinux-8-tiamat-py3: {extends: '.test_instance'}
144-
# centos-oraclelinux-7-tiamat-py3: {extends: '.test_instance'}
145-
# redhat8-almalinux-8-tiamat-py3: {extends: '.test_instance'}
146-
# redhat8-rockylinux-8-tiamat-py3: {extends: '.test_instance'}
147-
debian-debian-11-master-py3: {extends: '.test_instance_failure_permitted'}
148-
debian-debian-10-master-py3: {extends: '.test_instance'}
149-
debian-debian-9-master-py3: {extends: '.test_instance'}
150-
# ubuntu-ubuntu-2204-master-py3: {extends: '.test_instance_failure_permitted'}
151-
# ubuntu-ubuntu-2004-master-py3: {extends: '.test_instance'}
152-
ubuntu-ubuntu-1804-master-py3: {extends: '.test_instance'}
153-
redhat8-centos-stream8-master-py3: {extends: '.test_instance_failure_permitted'}
154-
centos-centos-7-master-py3: {extends: '.test_instance'}
155-
# fedora-fedora-36-master-py3: {extends: '.test_instance_failure_permitted'}
156-
# fedora-fedora-35-master-py3: {extends: '.test_instance'}
157-
suse-opensuse-leap-153-master-py3: {extends: '.test_instance'}
158-
suse-opensuse-tmbl-latest-master-py3: {extends: '.test_instance_failure_permitted'}
159-
amazon-amazonlinux-2-master-py3: {extends: '.test_instance'}
160-
redhat8-oraclelinux-8-master-py3: {extends: '.test_instance'}
161-
centos-oraclelinux-7-master-py3: {extends: '.test_instance'}
162-
arch-arch-base-latest-master-py3: {extends: '.test_instance'}
163-
gentoo-gentoo-stage3-latest-master-py3: {extends: '.test_instance'}
164-
gentoo-gentoo-stage3-systemd-master-py3: {extends: '.test_instance'}
165-
redhat8-almalinux-8-master-py3: {extends: '.test_instance'}
166-
redhat8-rockylinux-8-master-py3: {extends: '.test_instance'}
167-
# debian-debian-11-3004-1-py3: {extends: '.test_instance'}
168-
# debian-debian-10-3004-1-py3: {extends: '.test_instance'}
169-
# debian-debian-9-3004-1-py3: {extends: '.test_instance'}
170-
# ubuntu-ubuntu-2204-3004-1-py3: {extends: '.test_instance_failure_permitted'}
171-
# ubuntu-ubuntu-2004-3004-1-py3: {extends: '.test_instance'}
172-
# ubuntu-ubuntu-1804-3004-1-py3: {extends: '.test_instance'}
173-
# redhat8-centos-stream8-3004-1-py3: {extends: '.test_instance_failure_permitted'}
174-
# centos-centos-7-3004-1-py3: {extends: '.test_instance'}
175-
# fedora-fedora-36-3004-1-py3: {extends: '.test_instance_failure_permitted'}
176-
# fedora-fedora-35-3004-1-py3: {extends: '.test_instance'}
177-
# amazon-amazonlinux-2-3004-1-py3: {extends: '.test_instance'}
178-
# redhat8-oraclelinux-8-3004-1-py3: {extends: '.test_instance'}
179-
# centos-oraclelinux-7-3004-1-py3: {extends: '.test_instance'}
180-
# arch-arch-base-latest-3004-1-py3: {extends: '.test_instance'}
181-
# gentoo-gentoo-stage3-latest-3004-1-py3: {extends: '.test_instance'}
182-
# gentoo-gentoo-stage3-systemd-3004-1-py3: {extends: '.test_instance'}
183-
# redhat8-almalinux-8-3004-1-py3: {extends: '.test_instance'}
184-
# redhat8-rockylinux-8-3004-1-py3: {extends: '.test_instance'}
185-
# suse-opensuse-leap-153-3004-0-py3: {extends: '.test_instance'}
186-
# suse-opensuse-tmbl-latest-3004-0-py3: {extends: '.test_instance_failure_permitted'}
187-
# debian-debian-10-3003-4-py3: {extends: '.test_instance'}
188-
# debian-debian-9-3003-4-py3: {extends: '.test_instance'}
189-
# ubuntu-ubuntu-2004-3003-4-py3: {extends: '.test_instance'}
190-
# ubuntu-ubuntu-1804-3003-4-py3: {extends: '.test_instance'}
191-
# redhat8-centos-stream8-3003-4-py3: {extends: '.test_instance_failure_permitted'}
192-
# centos-centos-7-3003-4-py3: {extends: '.test_instance'}
193-
# amazon-amazonlinux-2-3003-4-py3: {extends: '.test_instance'}
194-
# redhat8-oraclelinux-8-3003-4-py3: {extends: '.test_instance'}
195-
# centos-oraclelinux-7-3003-4-py3: {extends: '.test_instance'}
196-
# redhat8-almalinux-8-3003-4-py3: {extends: '.test_instance'}
153+
debian-debian-12-master: {extends: '.test_instance'}
154+
debian-debian-11-master: {extends: '.test_instance'}
155+
debian-debian-12-3007-4: {extends: '.test_instance'}
156+
debian-debian-11-3007-4: {extends: '.test_instance'}
157+
debian-debian-12-3006-12: {extends: '.test_instance'}
158+
debian-debian-11-3006-12: {extends: '.test_instance'}
159+
ubuntu-ubuntu-2404-master: {extends: '.test_instance'}
160+
ubuntu-ubuntu-2204-master: {extends: '.test_instance'}
161+
ubuntu-ubuntu-2404-3007-4: {extends: '.test_instance'}
162+
ubuntu-ubuntu-2204-3007-4: {extends: '.test_instance'}
163+
ubuntu-ubuntu-2404-3006-12: {extends: '.test_instance'}
164+
ubuntu-ubuntu-2204-3006-12: {extends: '.test_instance'}
165+
fedora-fedora-40-master: {extends: '.test_instance'}
166+
fedora-fedora-40-3007-4: {extends: '.test_instance'}
167+
fedora-fedora-40-3006-12: {extends: '.test_instance'}
168+
suse-opensuse-leap-156-master: {extends: '.test_instance'}
169+
suse-opensuse-leap-156-3007-4: {extends: '.test_instance'}
170+
suse-opensuse-leap-156-3006-12: {extends: '.test_instance'}
197171
# yamllint enable rule:line-length
198172

199173
###############################################################################

.pre-commit-config.yaml

Lines changed: 62 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,63 +15,101 @@ ci:
1515
autoupdate_schedule: quarterly
1616
skip: []
1717
submodules: false
18-
default_stages: [commit]
18+
default_stages: [pre-commit]
1919
repos:
20-
- repo: https://github.com/dafyddj/commitlint-pre-commit-hook
21-
rev: v2.3.0
20+
- repo: https://github.com/pre-commit/pre-commit-hooks
21+
rev: v5.0.0
22+
hooks:
23+
- id: check-merge-conflict
24+
name: Check for Git merge conflicts
25+
args: [--assume-in-merge]
26+
exclude: ^docs/AUTHORS.rst$
27+
- repo: https://github.com/dafyddj/mirrors-commitlint
28+
rev: v19.8.1
2229
hooks:
2330
- id: commitlint
24-
name: Check commit message using commitlint
25-
description: Lint commit message against @commitlint/config-conventional rules
26-
stages: [commit-msg]
27-
additional_dependencies: ['@commitlint/[email protected]']
28-
- id: commitlint-travis
29-
stages: [manual]
30-
additional_dependencies: ['@commitlint/[email protected]']
31-
always_run: true
31+
- id: commitlint-ci
3232
- repo: https://github.com/rubocop-hq/rubocop
33-
rev: v1.30.1
33+
rev: v1.76.1
3434
hooks:
3535
- id: rubocop
3636
name: Check Ruby files with rubocop
3737
args: [--debug]
38-
always_run: true
39-
pass_filenames: false
4038
- repo: https://github.com/shellcheck-py/shellcheck-py
41-
rev: v0.8.0.4
39+
rev: v0.9.0.6
4240
hooks:
4341
- id: shellcheck
4442
name: Check shell scripts with shellcheck
4543
files: ^.*\.(sh|bash|ksh)$
4644
types: []
4745
- repo: https://github.com/adrienverge/yamllint
48-
rev: v1.26.3
46+
rev: v1.37.1
4947
hooks:
5048
- id: yamllint
5149
name: Check YAML syntax with yamllint
52-
args: [--strict, '.']
53-
always_run: true
54-
pass_filenames: false
50+
args: [--strict]
51+
types: [file]
52+
# Files to include
53+
# 1. Obvious YAML files
54+
# 2. `pillar.example` and similar files
55+
# 3. SLS files under directory `test/` which are pillar files
56+
# Files to exclude
57+
# 1. SLS files under directory `test/` which are state files
58+
# 2. `kitchen.vagrant.yml`, which contains Embedded Ruby (ERB) template syntax
59+
# 3. YAML files heavily reliant on Jinja
60+
# 4. `.copier-answers.yml` and its variants which are auto-generated
61+
files: |
62+
(?x)^(
63+
.*\.yaml|
64+
.*\.yml|
65+
\.salt-lint|
66+
\.yamllint|
67+
.*\.example|
68+
test/.*\.sls
69+
)$
70+
exclude: |
71+
(?x)^(
72+
\.copier-answers(\..+)?\.ya?ml|
73+
kitchen.vagrant.yml|
74+
test/.*/states/.*\.sls
75+
)$
5576
- repo: https://github.com/warpnet/salt-lint
56-
rev: v0.8.0
77+
rev: v0.9.2
5778
hooks:
5879
- id: salt-lint
5980
name: Check Salt files using salt-lint
6081
files: ^.*\.(sls|jinja|j2|tmpl|tst)$
61-
- repo: https://github.com/myint/rstcheck
62-
rev: 3f929574
82+
- repo: https://github.com/rstcheck/rstcheck
83+
rev: v6.2.5
6384
hooks:
6485
- id: rstcheck
6586
name: Check reST files using rstcheck
6687
exclude: 'docs/CHANGELOG.rst'
88+
additional_dependencies: [sphinx==7.2.6]
6789
- repo: https://github.com/saltstack-formulas/mirrors-rst-lint
68-
rev: v1.3.2
90+
rev: v1.4.0
6991
hooks:
7092
- id: rst-lint
7193
name: Check reST files using rst-lint
7294
exclude: |
7395
(?x)^(
7496
docs/CHANGELOG.rst|
7597
docs/TOFS_pattern.rst|
98+
docs/CONTRIBUTING_DOCS.rst|
99+
docs/index.rst|
76100
)$
77-
additional_dependencies: [pygments==2.9.0]
101+
additional_dependencies: [pygments==2.16.1]
102+
- repo: https://github.com/renovatebot/pre-commit-hooks
103+
rev: 40.48.11
104+
hooks:
105+
- id: renovate-config-validator
106+
name: Check Renovate config with renovate-config-validator
107+
- repo: https://github.com/python-jsonschema/check-jsonschema
108+
rev: 0.33.0
109+
hooks:
110+
- id: check-github-workflows
111+
name: Check GitHub workflows with check-jsonschema
112+
args: [--verbose]
113+
- id: check-gitlab-ci
114+
name: Check GitLab CI config with check-jsonschema
115+
args: [--verbose]

.rstcheck.cfg

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
[rstcheck]
22
report=info
33
ignore_language=rst
4-
ignore_messages=(Duplicate (ex|im)plicit target.*|Hyperlink target ".*" is not referenced\.$)
4+
# salt['config.get']('roles') is misidentified as a Markdown link.
5+
# Ignore for now, but perhaps try to submit a fix upstream in rstcheck
6+
ignore_messages=(Duplicate (ex|im)plicit target.*|Hyperlink target ".*" is not referenced\.$|\(rst\) Link is formatted in Markdown style\.)

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Layout/LineLength:
77
# Based on https://github.com/PyCQA/flake8-bugbear#opinionated-warnings (`B950`)
88
Max: 88
99
Metrics/BlockLength:
10-
IgnoredMethods:
10+
AllowedMethods:
1111
- control
1212
- describe
1313
# Increase from default of `25`

.yamllint

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,6 @@
44
# Extend the `default` configuration provided by `yamllint`
55
extends: 'default'
66

7-
# Files to ignore completely
8-
# 1. All YAML files under directory `.bundle/`, introduced if gems are installed locally
9-
# 2. All YAML files under directory `.cache/`, introduced during the CI run
10-
# 3. All YAML files under directory `.git/`
11-
# 4. All YAML files under directory `node_modules/`, introduced during the CI run
12-
# 5. Any SLS files under directory `test/`, which are actually state files
13-
# 6. Any YAML files under directory `.kitchen/`, introduced during local testing
14-
# 7. `kitchen.vagrant.yml`, which contains Embedded Ruby (ERB) template syntax
15-
ignore: |
16-
.bundle/
17-
.cache/
18-
.git/
19-
node_modules/
20-
test/**/states/**/*.sls
21-
.kitchen/
22-
kitchen.vagrant.yml
23-
24-
yaml-files:
25-
# Default settings
26-
- '*.yaml'
27-
- '*.yml'
28-
- .salt-lint
29-
- .yamllint
30-
# SaltStack Formulas additional settings
31-
- '*.example'
32-
- test/**/*.sls
33-
347
rules:
358
empty-values:
369
forbid-in-block-mappings: true

0 commit comments

Comments
 (0)