-
Notifications
You must be signed in to change notification settings - Fork 367
220 lines (188 loc) · 7.09 KB
/
Copy pathe2e.yaml
File metadata and controls
220 lines (188 loc) · 7.09 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
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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
name: E2E tests
on:
push:
branches:
- master
- "release-[0-9]+.[0-9]+*"
pull_request:
env:
KUBECTL_VERSION: 'v1.34.0'
jobs:
build:
name: Build ${{ matrix.image }} image
runs-on: ubuntu-latest
strategy:
matrix:
include:
- image: fluentd
context: images/fluentd
tags: fluentd-full:local
target: full
output: fluentd-full.tar
- image: controller
context: .
tags: controller:local
target: e2e-test
build_args: GO_BUILD_FLAGS=-cover -covermode=atomic
output: controller.tar
- image: config-reloader
context: images/config-reloader
tags: config-reloader:local
output: config-reloader.tar
- image: syslog-ng-reloader
context: images/syslog-ng-reloader
tags: syslog-ng-reloader:local
output: syslog-ng-reloader.tar
- image: fluentd-drain-watch
context: images/fluentd-drain-watch
tags: fluentd-drain-watch:local
output: fluentd-drain-watch.tar
- image: node-exporter
context: images/node-exporter
tags: node-exporter:local
output: node-exporter.tar
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
- name: Build and export ${{ matrix.image }}-image
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2
with:
context: ${{ matrix.context }}
tags: ${{ matrix.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max
target: ${{ matrix.target }}
build-args: ${{ matrix.build_args }}
outputs: type=docker,dest=/tmp/${{ matrix.output }}
- name: Upload artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: e2e-${{ matrix.image }}
path: /tmp/${{ matrix.output }}
go:
name: Go end2end tests
runs-on: ubuntu-latest
needs: build
strategy:
fail-fast: false
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false
# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: false
swap-storage: true
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
- name: Download artifact
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
pattern: e2e-*
path: /tmp
merge-multiple: true
- name: Load image
run: |
docker load --input /tmp/fluentd-full.tar
docker load --input /tmp/config-reloader.tar
docker load --input /tmp/syslog-ng-reloader.tar
docker load --input /tmp/fluentd-drain-watch.tar
docker load --input /tmp/node-exporter.tar
docker load --input /tmp/controller.tar
docker image ls -a
- name: Set up Go
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version-file: '.go-version'
- name: Set up kubectl
uses: azure/setup-kubectl@901a10e89ea615cf61f57ac05cecdf23e7de06d8 # v3
with:
version: ${{ env.KUBECTL_VERSION }}
- name: Run e2e tests
run: make test-e2e-ci
- name: Run coverage report
uses: vladopajic/go-test-coverage@a93b868a4cbcbf18dc3781650fad241f0020e609 # v2.18.8
with:
profile: ./build/_test_coverage/coverage_e2e.out
source-dir: ./
- name: Archive Test Results
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: go-e2e-test-cluster-logs
path: build/_test
retention-days: 5
chart:
name: Shell script tests with chart install
runs-on: ubuntu-latest
needs: build
strategy:
fail-fast: false
matrix:
kube: ["1.33", "1.34", "1.35"]
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
- name: Download artifact
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
pattern: e2e-*
path: /tmp
merge-multiple: true
- name: Load image
run: |
docker load --input /tmp/fluentd-full.tar
docker load --input /tmp/config-reloader.tar
docker load --input /tmp/syslog-ng-reloader.tar
docker load --input /tmp/fluentd-drain-watch.tar
docker load --input /tmp/node-exporter.tar
docker load --input /tmp/controller.tar
docker image ls -a
- name: Set up kubectl
uses: azure/setup-kubectl@776406bce94f63e41d621b960d78ee25c8b76ede # v4.0.1
with:
version: ${{ env.KUBECTL_VERSION }}
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# See https://github.com/kubernetes-sigs/kind/releases/tag/v0.20.0
- name: Determine KinD node image version
id: node_image
run: |
case ${{ matrix.kube }} in
1.33)
NODE_IMAGE=kindest/node:v1.33.0@sha256:02f73d6ae3f11ad5d543f16736a2cb2a63a300ad60e81dac22099b0b04784a4e ;;
1.34)
NODE_IMAGE=kindest/node:v1.34.0@sha256:7416a61b42b1662ca6ca89f02028ac133a309a2a30ba309614e8ec94d976dc5a ;;
1.35)
NODE_IMAGE=kindest/node:v1.35.0@sha256:452d707d4862f52530247495d180205e029056831160e22870e37e3f6c1ac31f
esac
echo "image=$NODE_IMAGE" >> $GITHUB_OUTPUT
- name: Make setup
run: make kind-cluster stern
env:
KIND_IMAGE: ${{ steps.node_image.outputs.image }}
- name: Test
run: hack/test.sh
- name: Print last 10k kubernetes logs from default and logging namespaces
if: always()
run: |
mkdir -p build/_test
bin/stern -n default,logging ".*" --tail 100000 --no-follow > build/_test/cluster.logs
- name: Archive Test Results
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: script-e2e-test-cluster-logs-${{ matrix.kube }}
path: build/_test
retention-days: 5