Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .copier-answers.ssf-ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
_commit: v1.5.0
_commit: v1.6.3
_src_path: https://github.com/dafyddj/copier-ssf-ci
failure_permitted_pattern: "(?x)(\n -master$|\n ^fedora-41-|\n ^amazonlinux-2-\n\
)"
Expand Down
146 changes: 87 additions & 59 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
only_branch_master_parent_repo: &only_branch_master_parent_repo
- 'master@saltstack-formulas/postfix-formula'
# `stage`
stage_cache: &stage_cache 'cache'
stage_lint: &stage_lint 'lint'
stage_release: &stage_release 'release'
stage_test: &stage_test 'test'
Expand All @@ -26,31 +27,64 @@
# yamllint enable rule:line-length
# `variables`
# https://forum.gitlab.com/t/gitlab-com-ci-caching-rubygems/5627/3
# https://bundler.io/v1.16/bundle_config.html
# https://bundler.io/v2.3/man/bundle-config.1.html
variables_bundler: &variables_bundler
BUNDLE_CACHE_PATH: '${CI_PROJECT_DIR}/.cache/bundler'
BUNDLE_WITHOUT: 'production'
# `cache`
BUNDLE_PATH: '${CI_PROJECT_DIR}/.cache/bundler'
BUNDLE_DEPLOYMENT: 'true'
bundle_install: &bundle_install
- 'bundle version'
- 'bundle config list'
# `--no-cache` means don't bother caching the downloaded .gem files
- 'time bundle install --no-cache'
cache_bundler: &cache_bundler
key: '${CI_JOB_STAGE}'
key:
files:
- 'Gemfile.lock'
prefix: 'bundler'
paths:
- '${BUNDLE_CACHE_PATH}'
- '${BUNDLE_PATH}'
# https://pre-commit.com/#gitlab-ci-example
variables_pre-commit: &variables_pre-commit
PRE_COMMIT_HOME: '${CI_PROJECT_DIR}/.cache/pre-commit'
cache_pre-commit: &cache_pre-commit
key:
files:
- '.pre-commit-config.yaml'
prefix: 'pre-commit'
paths:
- '${PRE_COMMIT_HOME}'

###############################################################################
# Define stages and global variables
###############################################################################
stages:
- *stage_cache
- *stage_lint
- *stage_test
- *stage_release
variables:
DOCKER_DRIVER: 'overlay2'


###############################################################################
# `cache` stage: build up the bundler cache required before the `test` stage
###############################################################################
build-cache:
stage: *stage_cache
image: *image_dindruby
variables: *variables_bundler
cache: *cache_bundler
script: *bundle_install

###############################################################################
# `lint` stage: `commitlint`, `pre-commit` & `rubocop` (latest, failure allowed)
###############################################################################
commitlint:
.lint_job:
stage: *stage_lint
needs: []

commitlint:
extends: '.lint_job'
image: *image_commitlint
script:
# Add `upstream` remote to get access to `upstream/master`
Expand All @@ -75,15 +109,11 @@ commitlint:
--verbose'

pre-commit:
stage: *stage_lint
extends: '.lint_job'
image: *image_precommit
# https://pre-commit.com/#gitlab-ci-example
variables:
PRE_COMMIT_HOME: '${CI_PROJECT_DIR}/.cache/pre-commit'
cache:
key: '${CI_JOB_NAME}'
paths:
- '${PRE_COMMIT_HOME}'
variables: *variables_pre-commit
cache: *cache_pre-commit
script:
- 'pre-commit run --all-files --color always --verbose'
- 'pre-commit run --color always --hook-stage manual commitlint-ci'
Expand All @@ -95,8 +125,8 @@ pre-commit:
# - Furthermore, this job uses all of the latest `rubocop` features & cops,
# which will help when upgrading the `rubocop` linter used in `pre-commit`
rubocop:
extends: '.lint_job'
allow_failure: true
stage: *stage_lint
image: *image_rubocop
script:
- 'rubocop -d -P -S --enable-pending-cops'
Expand All @@ -109,12 +139,10 @@ rubocop:
image: *image_dindruby
services: *services_docker_dind
variables: *variables_bundler
cache: *cache_bundler
before_script:
# TODO: This should work from the env vars above automatically
- 'bundle config set path "${BUNDLE_CACHE_PATH}"'
- 'bundle config set without "${BUNDLE_WITHOUT}"'
- 'bundle install'
cache:
<<: *cache_bundler
policy: 'pull'
before_script: *bundle_install
script:
# Alternative value to consider: `${CI_JOB_NAME}`
- 'bin/kitchen verify "${DOCKER_ENV_CI_JOB_NAME}"'
Expand Down Expand Up @@ -160,44 +188,44 @@ rockylinux-8-master: {extends: '.test_instance_failure_permitted'}
ubuntu-2404-master: {extends: '.test_instance_failure_permitted'}
ubuntu-2204-master: {extends: '.test_instance_failure_permitted'}
ubuntu-2004-master: {extends: '.test_instance_failure_permitted'}
almalinux-9-3007-2: {extends: '.test_instance'}
almalinux-8-3007-2: {extends: '.test_instance'}
amazonlinux-2023-3007-2: {extends: '.test_instance'}
amazonlinux-2-3007-2: {extends: '.test_instance_failure_permitted'}
centos-stream9-3007-2: {extends: '.test_instance'}
debian-12-3007-2: {extends: '.test_instance'}
debian-11-3007-2: {extends: '.test_instance'}
fedora-41-3007-2: {extends: '.test_instance_failure_permitted'}
fedora-40-3007-2: {extends: '.test_instance'}
opensuse-leap-156-3007-2: {extends: '.test_instance'}
opensuse-leap-155-3007-2: {extends: '.test_instance'}
opensuse-tmbl-latest-3007-2: {extends: '.test_instance'}
oraclelinux-9-3007-2: {extends: '.test_instance'}
oraclelinux-8-3007-2: {extends: '.test_instance'}
rockylinux-9-3007-2: {extends: '.test_instance'}
rockylinux-8-3007-2: {extends: '.test_instance'}
ubuntu-2404-3007-2: {extends: '.test_instance'}
ubuntu-2204-3007-2: {extends: '.test_instance'}
ubuntu-2004-3007-2: {extends: '.test_instance'}
almalinux-9-3006-10: {extends: '.test_instance'}
almalinux-8-3006-10: {extends: '.test_instance'}
amazonlinux-2023-3006-10: {extends: '.test_instance'}
amazonlinux-2-3006-10: {extends: '.test_instance_failure_permitted'}
centos-stream9-3006-10: {extends: '.test_instance'}
debian-12-3006-10: {extends: '.test_instance'}
debian-11-3006-10: {extends: '.test_instance'}
fedora-41-3006-10: {extends: '.test_instance_failure_permitted'}
fedora-40-3006-10: {extends: '.test_instance'}
opensuse-leap-156-3006-10: {extends: '.test_instance'}
opensuse-leap-155-3006-10: {extends: '.test_instance'}
opensuse-tmbl-latest-3006-10: {extends: '.test_instance'}
oraclelinux-9-3006-10: {extends: '.test_instance'}
oraclelinux-8-3006-10: {extends: '.test_instance'}
rockylinux-9-3006-10: {extends: '.test_instance'}
rockylinux-8-3006-10: {extends: '.test_instance'}
ubuntu-2404-3006-10: {extends: '.test_instance'}
ubuntu-2204-3006-10: {extends: '.test_instance'}
ubuntu-2004-3006-10: {extends: '.test_instance'}
almalinux-9-3007-3: {extends: '.test_instance'}
almalinux-8-3007-3: {extends: '.test_instance'}
amazonlinux-2023-3007-3: {extends: '.test_instance'}
amazonlinux-2-3007-3: {extends: '.test_instance_failure_permitted'}
centos-stream9-3007-3: {extends: '.test_instance'}
debian-12-3007-3: {extends: '.test_instance'}
debian-11-3007-3: {extends: '.test_instance'}
fedora-41-3007-3: {extends: '.test_instance_failure_permitted'}
fedora-40-3007-3: {extends: '.test_instance'}
opensuse-leap-156-3007-3: {extends: '.test_instance'}
opensuse-leap-155-3007-3: {extends: '.test_instance'}
opensuse-tmbl-latest-3007-3: {extends: '.test_instance'}
oraclelinux-9-3007-3: {extends: '.test_instance'}
oraclelinux-8-3007-3: {extends: '.test_instance'}
rockylinux-9-3007-3: {extends: '.test_instance'}
rockylinux-8-3007-3: {extends: '.test_instance'}
ubuntu-2404-3007-3: {extends: '.test_instance'}
ubuntu-2204-3007-3: {extends: '.test_instance'}
ubuntu-2004-3007-3: {extends: '.test_instance'}
almalinux-9-3006-11: {extends: '.test_instance'}
almalinux-8-3006-11: {extends: '.test_instance'}
amazonlinux-2023-3006-11: {extends: '.test_instance'}
amazonlinux-2-3006-11: {extends: '.test_instance_failure_permitted'}
centos-stream9-3006-11: {extends: '.test_instance'}
debian-12-3006-11: {extends: '.test_instance'}
debian-11-3006-11: {extends: '.test_instance'}
fedora-41-3006-11: {extends: '.test_instance_failure_permitted'}
fedora-40-3006-11: {extends: '.test_instance'}
opensuse-leap-156-3006-11: {extends: '.test_instance'}
opensuse-leap-155-3006-11: {extends: '.test_instance'}
opensuse-tmbl-latest-3006-11: {extends: '.test_instance'}
oraclelinux-9-3006-11: {extends: '.test_instance'}
oraclelinux-8-3006-11: {extends: '.test_instance'}
rockylinux-9-3006-11: {extends: '.test_instance'}
rockylinux-8-3006-11: {extends: '.test_instance'}
ubuntu-2404-3006-11: {extends: '.test_instance'}
ubuntu-2204-3006-11: {extends: '.test_instance'}
ubuntu-2004-3006-11: {extends: '.test_instance'}
# yamllint enable rule:line-length

###############################################################################
Expand Down
Loading
Loading