Skip to content

Commit c9199b9

Browse files
committed
chore: apply template copier-ssf-ci at v1.6.3
1 parent 83962eb commit c9199b9

File tree

14 files changed

+910
-669
lines changed

14 files changed

+910
-669
lines changed

.copier-answers.ssf-ci.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
2+
_commit: v1.6.3
3+
_src_path: https://github.com/dafyddj/copier-ssf-ci
4+
failure_permitted_pattern: (?x)(-master$|^fedora-41-|^amazonlinux-2-)
5+
formula_name: openssh
6+
renovate_extend_presets:
7+
- github>saltstack-formulas/.github
8+
- github>saltstack-formulas/.github:copier
9+
renovate_ignore_presets: []
10+
supported_oses:
11+
- AlmaLinux OS
12+
- Amazon Linux
13+
- CentOS
14+
- Debian
15+
- Fedora Linux
16+
- openSUSE
17+
- Oracle Linux
18+
- Rocky Linux
19+
- Ubuntu

.github/renovate.json5

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
$schema: 'https://docs.renovatebot.com/renovate-schema.json',
3+
extends: [
4+
"github>saltstack-formulas/.github",
5+
"github>saltstack-formulas/.github:copier"
6+
],
7+
/**********************************************************
8+
* This file is managed as part of a Copier template. *
9+
* Please make your own changes below this comment. *
10+
*********************************************************/
11+
}

.github/settings.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
# These settings are synced to GitHub by https://probot.github.io/apps/settings/
3+
4+
repository:
5+
# See https://docs.github.com/en/rest/reference/repos#update-a-repository
6+
# for all available settings
7+
8+
allow_squash_merge: false

.github/workflows/main.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
# yamllint disable rule:comments
3+
name: Test & release
4+
5+
'on':
6+
- pull_request
7+
- push
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: ${{ github.ref != format('refs/heads/{0}',
12+
github.event.repository.default_branch) }}
13+
14+
jobs:
15+
should-run:
16+
name: Prep / Should run
17+
runs-on: ubuntu-latest
18+
timeout-minutes: 5
19+
outputs:
20+
should-run: ${{ steps.action.outputs.should-run }}
21+
steps:
22+
- id: action
23+
uses:
24+
# yamllint disable-line rule:line-length
25+
techneg-it/should-workflow-run@dcbb88600d59ec2842778ef1e2d41f680f876329 # v1.0.0
26+
pre-commit:
27+
name: Lint / `pre-commit`
28+
needs: should-run
29+
if: fromJSON(needs.should-run.outputs.should-run)
30+
container: techneg/ci-pre-commit:v2.3.3
31+
runs-on: ubuntu-latest
32+
timeout-minutes: 5
33+
steps:
34+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
35+
- name: Export `CI_CACHE_ID` from container
36+
run: echo "CI_CACHE_ID=$(cat /.ci_cache_id)" >> $GITHUB_ENV
37+
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
38+
with:
39+
path: ~/.cache/pre-commit
40+
key: "${{ env.CI_CACHE_ID }}|\
41+
${{ hashFiles('.pre-commit-config.yaml') }}"
42+
- name: Run `pre-commit`
43+
run: |
44+
git config --global --add safe.directory $(pwd)
45+
pre-commit run --all-files --color always --verbose
46+
pre-commit run --color always --hook-stage manual commitlint-ci
47+
results:
48+
name: Release / Collect results
49+
permissions:
50+
checks: read
51+
runs-on: ubuntu-latest
52+
timeout-minutes: 15
53+
steps:
54+
# yamllint disable-line rule:line-length
55+
- uses: poseidon/wait-for-status-checks@899c768d191b56eef585c18f8558da19e1f3e707 # v0.6.0
56+
with:
57+
ignore: Release / Collect results
58+
ignore_pattern: ^GitLab CI
59+
token: ${{ secrets.GITHUB_TOKEN }}
60+
- run: echo "::notice ::Workflow success!"

.gitlab-ci.yml

Lines changed: 121 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -9,47 +9,82 @@
99
only_branch_master_parent_repo: &only_branch_master_parent_repo
1010
- 'master@saltstack-formulas/openssh-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.90@sha256:8334132f86e7241ed7eb5ac6469aa1a44c68f2b0923349209e7a7f403de18c97'
19+
image_dindruby: &image_dindruby 'techneg/ci-docker-python-ruby:v2.2.59@sha256:df2308e9c162f73c2094a913dcd29baccb07e3fd677418a74437e7780a7bcd1b'
20+
image_dindrubybionic: &image_dindrubybionic 'techneg/ci-docker-python-ruby:v2.2.59@sha256:df2308e9c162f73c2094a913dcd29baccb07e3fd677418a74437e7780a7bcd1b'
21+
image_precommit: &image_precommit 'techneg/ci-pre-commit:v2.4.24@sha256:0508ba9bb36bbfe9c12da5745cfb85159cdfbf8453c64fb63c9ca4d6e6cca679'
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:bbc590727c1e4fe707877314ff4f0f977bdda2985c485f2b044db0e18979efb3'
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
4565
variables:
4666
DOCKER_DRIVER: 'overlay2'
4767

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+
4879
###############################################################################
4980
# `lint` stage: `commitlint`, `pre-commit` & `rubocop` (latest, failure allowed)
5081
###############################################################################
51-
commitlint:
82+
.lint_job:
5283
stage: *stage_lint
84+
needs: []
85+
86+
commitlint:
87+
extends: '.lint_job'
5388
image: *image_commitlint
5489
script:
5590
# Add `upstream` remote to get access to `upstream/master`
@@ -74,17 +109,14 @@ commitlint:
74109
--verbose'
75110

76111
pre-commit:
77-
stage: *stage_lint
112+
extends: '.lint_job'
78113
image: *image_precommit
79114
# 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
86117
script:
87118
- 'pre-commit run --all-files --color always --verbose'
119+
- 'pre-commit run --color always --hook-stage manual commitlint-ci'
88120

89121
# Use a separate job for `rubocop` other than the one potentially run by `pre-commit`
90122
# - The `pre-commit` check will only be available for formulas that pass the default
@@ -93,8 +125,8 @@ pre-commit:
93125
# - Furthermore, this job uses all of the latest `rubocop` features & cops,
94126
# which will help when upgrading the `rubocop` linter used in `pre-commit`
95127
rubocop:
128+
extends: '.lint_job'
96129
allow_failure: true
97-
stage: *stage_lint
98130
image: *image_rubocop
99131
script:
100132
- 'rubocop -d -P -S --enable-pending-cops'
@@ -107,12 +139,10 @@ rubocop:
107139
image: *image_dindruby
108140
services: *services_docker_dind
109141
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
116146
script:
117147
# Alternative value to consider: `${CI_JOB_NAME}`
118148
- 'bin/kitchen verify "${DOCKER_ENV_CI_JOB_NAME}"'
@@ -131,69 +161,68 @@ rubocop:
131161
# Make sure the instances listed below match up with
132162
# the `platforms` defined in `kitchen.yml`
133163
# 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+
# Fedora 41+ will permit failure until this PR is merged into kitchen-docker
165+
# https://github.com/test-kitchen/kitchen-docker/pull/427 is merged
166+
# OpenSUSE master branch will fail until zypperpkg module is back in salt core
167+
# https://github.com/saltstack/great-module-migration/issues/14
168+
#
169+
almalinux-9-master: {extends: '.test_instance_failure_permitted'}
170+
almalinux-8-master: {extends: '.test_instance_failure_permitted'}
171+
amazonlinux-2023-master: {extends: '.test_instance_failure_permitted'}
172+
amazonlinux-2-master: {extends: '.test_instance_failure_permitted'}
173+
centos-stream9-master: {extends: '.test_instance_failure_permitted'}
174+
debian-12-master: {extends: '.test_instance_failure_permitted'}
175+
debian-11-master: {extends: '.test_instance_failure_permitted'}
176+
fedora-41-master: {extends: '.test_instance_failure_permitted'}
177+
fedora-40-master: {extends: '.test_instance_failure_permitted'}
178+
opensuse-leap-156-master: {extends: '.test_instance_failure_permitted'}
179+
opensuse-leap-155-master: {extends: '.test_instance_failure_permitted'}
180+
opensuse-tmbl-latest-master: {extends: '.test_instance_failure_permitted'}
181+
oraclelinux-9-master: {extends: '.test_instance_failure_permitted'}
182+
oraclelinux-8-master: {extends: '.test_instance_failure_permitted'}
183+
rockylinux-9-master: {extends: '.test_instance_failure_permitted'}
184+
rockylinux-8-master: {extends: '.test_instance_failure_permitted'}
185+
ubuntu-2404-master: {extends: '.test_instance_failure_permitted'}
186+
ubuntu-2204-master: {extends: '.test_instance_failure_permitted'}
187+
ubuntu-2004-master: {extends: '.test_instance_failure_permitted'}
188+
almalinux-9-3007-3: {extends: '.test_instance'}
189+
almalinux-8-3007-3: {extends: '.test_instance'}
190+
amazonlinux-2023-3007-3: {extends: '.test_instance'}
191+
amazonlinux-2-3007-3: {extends: '.test_instance_failure_permitted'}
192+
centos-stream9-3007-3: {extends: '.test_instance'}
193+
debian-12-3007-3: {extends: '.test_instance'}
194+
debian-11-3007-3: {extends: '.test_instance'}
195+
fedora-41-3007-3: {extends: '.test_instance_failure_permitted'}
196+
fedora-40-3007-3: {extends: '.test_instance'}
197+
opensuse-leap-156-3007-3: {extends: '.test_instance'}
198+
opensuse-leap-155-3007-3: {extends: '.test_instance'}
199+
opensuse-tmbl-latest-3007-3: {extends: '.test_instance'}
200+
oraclelinux-9-3007-3: {extends: '.test_instance'}
201+
oraclelinux-8-3007-3: {extends: '.test_instance'}
202+
rockylinux-9-3007-3: {extends: '.test_instance'}
203+
rockylinux-8-3007-3: {extends: '.test_instance'}
204+
ubuntu-2404-3007-3: {extends: '.test_instance'}
205+
ubuntu-2204-3007-3: {extends: '.test_instance'}
206+
ubuntu-2004-3007-3: {extends: '.test_instance'}
207+
almalinux-9-3006-11: {extends: '.test_instance'}
208+
almalinux-8-3006-11: {extends: '.test_instance'}
209+
amazonlinux-2023-3006-11: {extends: '.test_instance'}
210+
amazonlinux-2-3006-11: {extends: '.test_instance_failure_permitted'}
211+
centos-stream9-3006-11: {extends: '.test_instance'}
212+
debian-12-3006-11: {extends: '.test_instance'}
213+
debian-11-3006-11: {extends: '.test_instance'}
214+
fedora-41-3006-11: {extends: '.test_instance_failure_permitted'}
215+
fedora-40-3006-11: {extends: '.test_instance'}
216+
opensuse-leap-156-3006-11: {extends: '.test_instance'}
217+
opensuse-leap-155-3006-11: {extends: '.test_instance'}
218+
opensuse-tmbl-latest-3006-11: {extends: '.test_instance'}
219+
oraclelinux-9-3006-11: {extends: '.test_instance'}
220+
oraclelinux-8-3006-11: {extends: '.test_instance'}
221+
rockylinux-9-3006-11: {extends: '.test_instance'}
222+
rockylinux-8-3006-11: {extends: '.test_instance'}
223+
ubuntu-2404-3006-11: {extends: '.test_instance'}
224+
ubuntu-2204-3006-11: {extends: '.test_instance'}
225+
ubuntu-2004-3006-11: {extends: '.test_instance'}
197226
# yamllint enable rule:line-length
198227

199228
###############################################################################

0 commit comments

Comments
 (0)