-
Notifications
You must be signed in to change notification settings - Fork 26
230 lines (183 loc) · 6.32 KB
/
testing.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
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
221
222
223
224
225
226
227
228
229
230
---
name: Testing
on:
pull_request:
permissions: {}
env:
DEBUG_PRINT: true
jobs:
build-multiarch-images:
name: Build multi-arch images
needs: images
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Set up QEMU (to support building on non-native architectures)
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf
- name: Set up buildx
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349
- name: Restore images from the cache
uses: ./gh-actions/restore-images
- name: Build the multi-arch images
run: make multiarch-images
- name: Check that we actually built multi-arch images
run: bash -c '[ "$(echo package/*.tar)" != "package/*.tar" ]'
clean-clusters:
name: Clean up clusters
needs: images
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Restore images from the cache
uses: ./gh-actions/restore-images
- name: Deploy clusters
run: make clusters TIMEOUT=1m
- name: Clean up clusters
run: make clean-clusters
- name: Check that clusters are gone
run: test "$(kind get clusters 2>&1)" = "No kind clusters found."
clean-generated:
name: Clean up generated files
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Build images
run: make images
- name: Clean up generated files
run: make clean-generated
- name: Check that image markers are gone
run: test package/.image.* = "package/.image.*"
clusters:
name: Clusters
needs: images
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Restore images from the cache
uses: ./gh-actions/restore-images
- name: Deploy clusters
run: make clusters TIMEOUT=1m
- name: Post mortem
if: failure()
uses: ./gh-actions/post-mortem
compilation:
name: Compilation
needs: images
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Restore images from the cache
uses: ./gh-actions/restore-images
- name: Test the compile.sh script
run: make script-test SCRIPT_TEST_ARGS="test/scripts/compile/test.sh"
deployment:
name: Deployment
needs: images
timeout-minutes: 30
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
globalnet: ['', 'globalnet']
deploytool: ['operator', 'helm']
extra-toggles: ['']
include:
- extra-toggles: air-gap
- extra-toggles: air-gap
globalnet: globalnet
- extra-toggles: 'air-gap, lighthouse'
- extra-toggles: 'air-gap, ovn'
- extra-toggles: dual-stack
- extra-toggles: ovn
- extra-toggles: ovn-ic
- deploytool: operator
extra-toggles: lighthouse
- deploytool: helm
extra-toggles: lighthouse
- extra-toggles: load-balancer
- extra-toggles: prometheus
steps:
- name: Reclaim space on GHA host (if the job needs it)
if: ${{ contains('ovn', matrix.extra-toggles) }}
run: rm -rf /usr/share/dotnet
- name: Check out the repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
submodules: true
- name: Fetch all git tags
run: git fetch origin +refs/tags/*:refs/tags/*
- name: Restore images from the cache
uses: ./gh-actions/restore-images
- name: Deploy clusters and Submariner
run: make deploy using="${{ matrix.globalnet }} ${{ matrix.deploytool }} ${{ matrix.extra-toggles }}" TIMEOUT=1m
- name: Post mortem
if: failure()
uses: ./gh-actions/post-mortem
e2e:
name: E2E
needs: images
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Restore images from the cache
uses: ./gh-actions/restore-images
- name: Run E2E deployment and tests
run: make e2e
- name: Post mortem
if: failure()
uses: ./gh-actions/post-mortem
images:
name: Images
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Build the images if necessary
uses: ./gh-actions/cache-images
mutliple-gateways-support:
name: Multiple gateways support
needs: images
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Restore images from the cache
uses: ./gh-actions/restore-images
- name: Deploy clusters and test cloud-prepare
run: make script-test SCRIPT_TEST_ARGS="test/scripts/cloud-prepare/test.sh"
post-mortem:
name: Post mortem
needs: images
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Restore images from the cache
uses: ./gh-actions/restore-images
- name: Deploy some clusters
run: make clusters
- name: Test the post_mortem.sh script
run: make script-test SCRIPT_TEST_ARGS="test/scripts/post_mortem/test.sh"
unit:
name: Unit tests
needs: images
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Restore images from the cache
uses: ./gh-actions/restore-images
- name: Running `make unit` is expected to pass
run: make unit
- name: Running `make unit` is expected to fail
run: sh -c '! make unit TEST_ARGS="--fail"'