-
Notifications
You must be signed in to change notification settings - Fork 133
157 lines (149 loc) · 4.63 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
---
name: "Tests"
env:
cinc_workstation_version: 23
on:
push:
branches:
- '*'
pull_request:
branches:
- master
jobs:
cookstyle:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v3
with:
path: |
.cache
key: ${{ runner.os }}-${{ env.cinc_workstation_version }}
- name: setup environment
run: |
mkdir -p .cache
curl -L https://omnitruck.cinc.sh/install.sh | sudo bash -s -- -P cinc-workstation -d .cache -v ${{ env.cinc_workstation_version }}
- name: cookstyle
run: |
cinc exec cookstyle --fail-level r
kitchen-dokken:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
cinc_version: [ '17', '18' ]
kitchen_distro:
- amazonlinux-1
- amazonlinux-2
- centos-7
- centos-stream-8
- centos-stream-9
- almalinux-8
- almalinux-9
- rockylinux-8
- rockylinux-9
- oracle-7
- oracle-8
- oracle-9
- debian-10
- debian-11
- fedora-37
- fedora-38
# - opensuse-42 # something is broken here
- ubuntu-20-04
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v3
with:
path: |
.cache
key: ${{ runner.os }}-${{ env.cinc_workstation_version }}
- name: setup cinc workstation
run: |
mkdir -p .cache
curl -L https://omnitruck.cinc.sh/install.sh | sudo bash -s -- -P cinc-workstation -d .cache -v ${{ env.cinc_workstation_version }}
- name: kitchen
env:
CINC_VERSION: ${{ matrix.cinc_version }}
KITCHEN_LOCAL_YAML: .kitchen.dokken.yml
run: |
kitchen test --color --destroy=always ${{ matrix.kitchen_distro }}
kitchen-digitalocean:
if: github.repository == 'dev-sec/chef-os-hardening' && success()
needs: # run expensive VM tests only if cheap dokken tests are passing
- kitchen-dokken
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
cinc_version: [ '18' ]
kitchen_distro:
- default-centos-7
- default-centos-stream-8
- default-centos-stream-9
- default-almalinux-8
- default-almalinux-9
- default-rockylinux-8
- default-rockylinux-9
- default-ubuntu-20-04
- default-debian-10
- default-debian-11
- default-fedora-38
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v3
with:
path: |
.cache
key: ${{ runner.os }}-${{ env.cinc_workstation_version }}
- name: setup cinc workstation
run: |
mkdir -p .cache
curl -L https://omnitruck.cinc.sh/install.sh | sudo bash -s -- -P cinc-workstation -d .cache -v ${{ env.cinc_workstation_version }}
- name: setup ssh key
env:
SSH_KEY: ${{ secrets.DO_SSH_KEY }}
run: |
mkdir -p ~/.ssh
echo "$SSH_KEY" > ~/.ssh/id_rsa
chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_rsa
- name: kitchen
env:
CINC_VERSION: ${{ matrix.cinc_version }}
KITCHEN_LOCAL_YAML: .kitchen.do.yml
DIGITALOCEAN_SSH_KEY_IDS: ${{ secrets.DO_SSH_KEY_ID }}
DIGITALOCEAN_ACCESS_TOKEN: ${{ secrets.DO_ACCESS_TOKEN }}
run: |
kitchen test --color --destroy=always ${{ matrix.kitchen_distro }}
pass-all-jobs:
if: "!(github.repository == 'dev-sec/chef-os-hardening' && startsWith(github.head_ref, 'release/v')) && always()"
needs:
- cookstyle
- kitchen-dokken
runs-on: ubuntu-latest
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
pass-all-jobs-with-digitalocean:
if: "(github.repository == 'dev-sec/chef-os-hardening' && !(startsWith(github.head_ref, 'release/v'))) && always()"
needs:
- cookstyle
- kitchen-dokken
- kitchen-digitalocean
runs-on: ubuntu-latest
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
pass-all-jobs-release:
if: "github.repository == 'dev-sec/chef-os-hardening' && startsWith(github.head_ref, 'release/v') && always()"
runs-on: ubuntu-latest
steps:
- name: happy releasing
run: |
echo "Happy releasing :-)"
# this is just a succeessfull placeholder to make release PR pass