-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (88 loc) · 2.74 KB
/
Copy pathkitchen.yml
File metadata and controls
99 lines (88 loc) · 2.74 KB
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
name: Kitchen
on:
push:
branches: [main]
paths:
- 'config/**'
- 'internal/**'
- 'cmd/**'
- 'lib/**'
- '.kitchen.yml'
- 'examples/**/.kitchen.yml'
- 'examples/**/config/**'
pull_request:
branches: [main]
workflow_dispatch:
inputs:
platform:
description: 'Platform filter (leave empty for all)'
required: false
default: ''
jobs:
kitchen:
name: Kitchen (${{ matrix.platform }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform:
- ubuntu-22.04
- debian-12
- rockylinux-9
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version: "1.26.x"
cache: true
# Build the gomnibus binary that will be copied into each container.
- name: Build gomnibus
run: CGO_ENABLED=0 go build -o gomnibus ./cmd/gomnibus
# Pull the Docker image before running kitchen so network failures
# don't count as kitchen test failures.
- name: Pull Docker image
run: |
case "${{ matrix.platform }}" in
ubuntu-22.04) docker pull ubuntu:22.04 ;;
debian-12) docker pull debian:12 ;;
rockylinux-9) docker pull rockylinux:9 ;;
esac
- name: kitchen test ${{ matrix.platform }}
working-directory: examples/myapp
run: |
../../gomnibus kitchen test "${{ matrix.platform }}" \
--output ../../pkg/kitchen \
--log-level info
env:
# Pass through any S3 cache credentials if configured.
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
# Always destroy the container, even if the build failed.
- name: kitchen destroy ${{ matrix.platform }}
working-directory: examples/myapp
if: always()
run: |
../../gomnibus kitchen destroy "${{ matrix.platform }}" \
--log-level warn || true
- name: Upload packages
if: success()
uses: actions/upload-artifact@v7
with:
name: packages-${{ matrix.platform }}
path: pkg/kitchen/${{ matrix.platform }}/
if-no-files-found: warn
retention-days: 7
kitchen-summary:
name: Kitchen Summary
runs-on: ubuntu-latest
needs: kitchen
if: always()
steps:
- name: Check matrix status
run: |
if [ "${{ needs.kitchen.result }}" = "failure" ]; then
echo "One or more kitchen platform builds failed"
exit 1
fi
echo "All kitchen platforms passed"