Skip to content

Commit 7c9d38c

Browse files
authored
Merge pull request #569 from dafyddj/chore/copier
chore: apply template `copier-ssf-ci` at v2.0.1
2 parents bf52207 + 518db2e commit 7c9d38c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+2103
-1015
lines changed

.copier-answers.ssf-ci.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
2+
_commit: v2.0.1
3+
_src_path: https://github.com/dafyddj/copier-ssf-ci
4+
failure_permitted_ignored: []
5+
failure_permitted_patterns: []
6+
formula_name: salt
7+
renovate_extend_presets:
8+
- github>saltstack-formulas/.github
9+
- github>saltstack-formulas/.github:copier
10+
renovate_ignore_presets: []
11+
supported_oses:
12+
- AlmaLinux OS
13+
- Amazon Linux
14+
- CentOS
15+
- Debian
16+
- Fedora Linux
17+
- openSUSE
18+
- Oracle Linux
19+
- Rocky Linux
20+
- 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/kitchen.macos.yml

Lines changed: 6 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -2,70 +2,24 @@
22
# vim: ft=yaml
33
---
44
name: 'Kitchen (macOS)'
5-
'on': ['push', 'pull_request']
5+
'on': ['workflow_dispatch']
66

77
env:
88
KITCHEN_LOCAL_YAML: 'kitchen.macos.yml'
99

1010
jobs:
11-
test-12:
12-
runs-on: 'macos-12'
11+
test-13:
12+
runs-on: 'macos-13'
1313
strategy:
1414
fail-fast: false
1515
matrix:
1616
instance:
17-
- default-macos-12-latest-py3
17+
- default-macos-13-latest
1818
steps:
1919
- name: 'Check out code'
20-
uses: 'actions/checkout@v2'
20+
uses: 'actions/checkout@v4'
2121
- name: 'Set up Bundler cache'
22-
uses: 'actions/cache@v1'
23-
with:
24-
path: 'vendor/bundle'
25-
key: "${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}"
26-
restore-keys: "${{ runner.os }}-gems-"
27-
- name: 'Run Bundler'
28-
run: |
29-
ruby --version
30-
bundle config path vendor/bundle
31-
bundle install --jobs 4 --retry 3
32-
- name: 'Run Test Kitchen'
33-
run: 'bundle exec kitchen verify ${{ matrix.instance }}'
34-
test-11:
35-
runs-on: 'macos-11'
36-
strategy:
37-
fail-fast: false
38-
matrix:
39-
instance:
40-
- default-macos-11-latest-py3
41-
steps:
42-
- name: 'Check out code'
43-
uses: 'actions/checkout@v2'
44-
- name: 'Set up Bundler cache'
45-
uses: 'actions/cache@v1'
46-
with:
47-
path: 'vendor/bundle'
48-
key: "${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}"
49-
restore-keys: "${{ runner.os }}-gems-"
50-
- name: 'Run Bundler'
51-
run: |
52-
ruby --version
53-
bundle config path vendor/bundle
54-
bundle install --jobs 4 --retry 3
55-
- name: 'Run Test Kitchen'
56-
run: 'bundle exec kitchen verify ${{ matrix.instance }}'
57-
test-1015:
58-
runs-on: 'macos-10.15'
59-
strategy:
60-
fail-fast: false
61-
matrix:
62-
instance:
63-
- default-macos-1015-latest-py3
64-
steps:
65-
- name: 'Check out code'
66-
uses: 'actions/checkout@v2'
67-
- name: 'Set up Bundler cache'
68-
uses: 'actions/cache@v1'
22+
uses: 'actions/cache@v4'
6923
with:
7024
path: 'vendor/bundle'
7125
key: "${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}"

.github/workflows/kitchen.vagrant.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# vim: ft=yaml
33
---
44
name: 'Kitchen Vagrant (FreeBSD, OpenBSD & Windows)'
5-
'on': ['push', 'pull_request']
5+
'on': ['workflow_dispatch']
66

77
env:
88
KITCHEN_LOCAL_YAML: 'kitchen.vagrant.yml'

.github/workflows/kitchen.windows.yml

Lines changed: 13 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# vim: ft=yaml
33
---
44
name: 'Kitchen (Windows)'
5-
'on': ['push', 'pull_request']
5+
'on': ['workflow_dispatch']
66

77
env:
88
machine_user: kitchen
@@ -17,27 +17,15 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
instance:
20-
- default-windows-2022-latest-py3
20+
- default-windows-2022-latest
2121
steps:
2222
- name: 'Check out code'
23-
uses: 'actions/checkout@v2'
24-
- name: 'Install Chef'
25-
uses: 'actionshub/chef-install@1.1.0'
23+
uses: 'actions/checkout@v4'
24+
- name: 'Set up Ruby'
25+
uses: ruby/setup-ruby@v1
2626
with:
27-
project: 'chef'
28-
version: '16.10.8'
29-
- name: 'Add Chef bindir to PATH'
30-
uses: 'myci-actions/export-env-var-powershell@1'
31-
with:
32-
name: 'PATH'
33-
value: "C:\\opscode\\chef\\bin;\
34-
C:\\opscode\\chef\\embedded\\bin;$env:PATH"
35-
- name: 'Set up Bundler cache'
36-
uses: 'actions/cache@v1'
37-
with:
38-
path: 'vendor/bundle'
39-
key: "${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}"
40-
restore-keys: "${{ runner.os }}-gems-"
27+
ruby-version: '3.1.6'
28+
bundler-cache: true
4129
- name: 'Set up test user'
4230
run: |
4331
$password = ConvertTo-SecureString $env:machine_pass -AsPlainText -Force
@@ -59,27 +47,15 @@ jobs:
5947
fail-fast: false
6048
matrix:
6149
instance:
62-
- default-windows-2019-latest-py3
50+
- default-windows-2019-latest
6351
steps:
6452
- name: 'Check out code'
65-
uses: 'actions/checkout@v2'
66-
- name: 'Install Chef'
67-
uses: 'actionshub/chef-install@1.1.0'
68-
with:
69-
project: 'chef'
70-
version: '16.10.8'
71-
- name: 'Add Chef bindir to PATH'
72-
uses: 'myci-actions/export-env-var-powershell@1'
53+
uses: 'actions/checkout@v4'
54+
- name: 'Set up Ruby'
55+
uses: ruby/setup-ruby@v1
7356
with:
74-
name: 'PATH'
75-
value: "C:\\opscode\\chef\\bin;\
76-
C:\\opscode\\chef\\embedded\\bin;$env:PATH"
77-
- name: 'Set up Bundler cache'
78-
uses: 'actions/cache@v1'
79-
with:
80-
path: 'vendor/bundle'
81-
key: "${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}"
82-
restore-keys: "${{ runner.os }}-gems-"
57+
ruby-version: '3.1.6'
58+
bundler-cache: true
8359
- name: 'Set up test user'
8460
run: |
8561
$password = ConvertTo-SecureString $env:machine_pass -AsPlainText -Force
@@ -88,10 +64,5 @@ jobs:
8864
- name: 'Set up WinRM'
8965
run: |
9066
Set-WSManQuickConfig -Force
91-
- name: 'Run Bundler'
92-
run: |
93-
ruby --version
94-
bundle config path vendor/bundle
95-
bundle install --jobs 4 --retry 3
9667
- name: 'Run Test Kitchen'
9768
run: 'bundle exec kitchen verify ${{ matrix.instance }}'

.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!"

0 commit comments

Comments
 (0)