-
Notifications
You must be signed in to change notification settings - Fork 48
190 lines (159 loc) · 4.5 KB
/
go.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
name: Go build
on:
push:
branches:
- main
- release-*
paths-ignore:
- 'config/**'
- 'docs/**'
- 'mkdocs.yml'
- '**.md'
- LICENSE
- '**.svg'
pull_request:
branches:
- main
- release-*
paths-ignore:
- 'config/**'
- 'docs/**'
- 'mkdocs.yml'
- '**.md'
- LICENSE
- '**.svg'
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
fetch-depth: 0 # for `git describe`
persist-credentials: false
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod
- name: Build
run: |
make build
- name: Build image
run: |
make docker-build
generate-sbom:
name: "Build :: SBOM"
needs: [ build ]
runs-on: ubuntu-22.04
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Generate SBOM
run: |
mkdir -p sbom && chmod 777 sbom
make sbom/spdx.json
- uses: actions/upload-artifact@v3
with:
name: spdx.json
path: sbom/spdx.json
unittest:
name: Unit test
needs: build
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod
- name: Run unit tests
run: |
make test
smoketest:
name: Smoke test
needs: build
runs-on: ubuntu-22.04-8core
strategy:
fail-fast: false
matrix:
smoke-suite:
- check-basic
- check-hostpath
- check-ha-controller
- check-ha-controller-secret
- check-jointoken
- check-monitoring
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod
- name: Create image bundle
run: |
make release
make k0smotron-image-bundle.tar
- name: Run inttest
run: |
make -C inttest ${{ matrix.smoke-suite }}
capi-smokes:
name: Cluster API smoke tests
needs: build
runs-on: ubuntu-22.04-8core
strategy:
fail-fast: false
matrix:
smoke-suite:
- check-capi-docker
- check-capi-docker-machinedeployment
- check-capi-controlplane-docker
- check-capi-controlplane-docker-downscaling
- check-capi-controlplane-docker-tunneling
- check-capi-controlplane-docker-tunneling-proxy
- check-capi-controlplane-docker-worker
- check-capi-remote-machine
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod
- name: Create image bundle
run: |
make release
make k0smotron-image-bundle.tar
- name: Create kind network with IPv4 only
run: |
docker network create kind --opt com.docker.network.bridge.enable_ip_masquerade=true
- name: Download kind
uses: supplypike/setup-bin@v3
with:
name: kind
version: v0.19.0
uri: https://github.com/kubernetes-sigs/kind/releases/download/v0.19.0/kind-linux-amd64
- name: Setup KinD cluster
run: |
kind create cluster --config config/samples/capi/docker/kind.yaml
- name: Load k0smotron image to KinD and install k0smotron controllers
run: |
kind load image-archive k0smotron-image-bundle.tar
kubectl apply -f install.yaml
- name: Download clusterctl
uses: supplypike/setup-bin@v3
with:
name: clusterctl
version: v1.4.3
uri: https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.4.3/clusterctl-linux-amd64
- name: Install cluster api components
run: |
clusterctl init --infrastructure docker
- name: Run inttest for CAPI with docker provider
run: |
kind get kubeconfig > kind.conf
export KUBECONFIG=$(realpath kind.conf)
docker system prune -f
make -C inttest ${{ matrix.smoke-suite }}