-
Notifications
You must be signed in to change notification settings - Fork 2
72 lines (70 loc) · 2.14 KB
/
main.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
---
name: ci
# yamllint disable-line rule:truthy
on:
push:
branches: [latest]
pull_request:
branches: ['*']
jobs:
yamllint:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@main
- name: Run yaml Lint
uses: actionshub/yamllint@main
kitchen-ci:
runs-on: ubuntu-20.04
name: Kitchen CI
strategy:
matrix:
suite:
- 'agent'
- 'repo'
- 'jenkins'
chef_version:
- '17'
fail-fast: false
steps:
- name: Check out code
uses: actions/checkout@main
- name: Install Chef
uses: actionshub/chef-install@main
- name: Test-Kitchen
uses: actionshub/test-kitchen@main
with:
suite: ${{ matrix.suite }}
os: 'ubuntu-2004'
env:
CHEF_LICENSE: accept-no-persist
CHEF_VERSION: ${{ matrix.chef_version }}
KITCHEN_LOCAL_YAML: kitchen.dokken.yml
- name: Print debug output (journalctl)
if: failure()
run: |
set -x
KITCHEN_LOCAL_YAML=kitchen.dokken.yml /usr/bin/kitchen exec \
${{ matrix.suite }}-${{ matrix.os }} \
-c "journalctl -l"
- name: Print debug output on failure (jenkins.log)
if: failure() && matrix.suite == 'jenkins'
run: |
set -x
KITCHEN_LOCAL_YAML=kitchen.dokken.yml /usr/bin/kitchen exec \
${{ matrix.suite }}-${{ matrix.os }} \
-c "cat /var/log/jenkins/jenkins.log"
- name: Print debug output on failure (systemctl jenkins status)
if: failure() && matrix.suite == 'jenkins'
run: |
set -x
KITCHEN_LOCAL_YAML=kitchen.dokken.yml /usr/bin/kitchen exec \
${{ matrix.suite }}-${{ matrix.os }} \
-c "systemctl status jenkins"
- name: Print debug output (jenkins-agent)
if: failure()
run: |
set -x
KITCHEN_LOCAL_YAML=kitchen.dokken.yml /usr/bin/kitchen exec \
${{ matrix.suite }}-${{ matrix.os }} \
-c "systemctl status jenkins-agent"