-
Notifications
You must be signed in to change notification settings - Fork 64
150 lines (145 loc) · 4.93 KB
/
cts.yaml
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
name: Compatibility Test Suite
on:
workflow_dispatch:
schedule:
- cron: '0 */6 * * *'
push:
tags:
- "*"
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
kubernetes-env:
- minikube
- k3s
kubernetes-version:
- "v1.22.0"
- "v1.23.0"
- "v1.24.0"
- "v1.25.0"
- "v1.26.0"
- "v1.27.0"
steps:
- if: matrix.kubernetes-env == 'k3s'
run: |
INSTALL_K3S_VERSION="${{ matrix.kubernetes-version }}+k3s1" curl -sfL https://get.k3s.io | sh -
sudo chmod 644 /etc/rancher/k3s/k3s.yaml
echo "KUBECONFIG=/etc/rancher/k3s/k3s.yaml" >> $GITHUB_ENV
- if: matrix.kubernetes-env == 'minikube'
run: minikube start --kubernetes-version="${{ matrix.kubernetes-version }}"
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '1.20'
- name: install kubebuilder
run: |
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m | sed 's/x86_64/amd64/')
curl -fsL "https://storage.googleapis.com/kubebuilder-tools/kubebuilder-tools-1.16.4-${OS}-${ARCH}.tar.gz" -o kubebuilder-tools
tar -zxvf kubebuilder-tools
sudo mv kubebuilder/ /usr/local/kubebuilder
- name: Install Telepresence
env:
TELEPRESENCE_VERSION: 2.13.3
run: |
sudo curl -fL https://app.getambassador.io/download/tel2/linux/amd64/${TELEPRESENCE_VERSION}/telepresence -o /usr/local/bin/telepresence
sudo chmod a+x /usr/local/bin/telepresence
- run: telepresence helm install
- run: telepresence connect
- run: make test
- uses: codecov/codecov-action@v3
with:
files: ./cover.out # optional
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)
build-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v2
- uses: docker/setup-qemu-action@v2
with:
image: tonistiigi/binfmt:latest
platforms: all
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- uses: docker/metadata-action@v4
id: meta
with:
images: ghcr.io/${{ github.repository }}
flavor: |
latest=true
tags: |
type=ref,event=branch
type=ref,event=tag
type=semver,pattern={{version}}
- uses: docker/build-push-action@v3
with:
push: true
pull: true
no-cache: true
platforms: linux/amd64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
deployment:
runs-on: ubuntu-latest
needs: build-image
strategy:
fail-fast: false
matrix:
kubernetes-env:
- minikube
- k3s
kubernetes-version:
- "v1.22.0"
- "v1.23.0"
- "v1.24.0"
- "v1.25.0"
- "v1.26.0"
- "v1.27.0"
emqx:
- [EmqxBroker, emqx, "config/samples/emqx/v1beta4/emqxbroker-slim.yaml"]
- [EmqxBroker, emqx, "config/samples/emqx/v1beta4/emqxbroker-full.yaml"]
- [EmqxEnterprise, emqx-ee, "config/samples/emqx/v1beta4/emqxenterprise-slim.yaml"]
- [EmqxEnterprise, emqx-ee, "config/samples/emqx/v1beta4/emqxenterprise-full.yaml"]
- [EMQX, emqx, "config/samples/emqx/v2beta1/emqx-slim.yaml"]
- [EMQX, emqx, "config/samples/emqx/v2beta1/emqx-full.yaml"]
steps:
- if: matrix.kubernetes-env == 'k3s'
run: |
curl -sfL https://get.k3s.io | sh -
sudo chmod 644 /etc/rancher/k3s/k3s.yaml
echo "KUBECONFIG=/etc/rancher/k3s/k3s.yaml" >> $GITHUB_ENV
- if: matrix.kubernetes-env == 'minikube'
run: minikube start --kubernetes-version="${{ matrix.kubernetes-version }}"
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '1.20'
- name: Deploy operator
timeout-minutes: 5
uses: ./.github/actions/deploy-operator
with:
repository: ghcr.io/${{ github.repository }}
tag: ${{ github.ref_name }}
- name: Deploy emqx
timeout-minutes: 5
uses: ./.github/actions/deploy-emqx
with:
kind: ${{ matrix.emqx[0] }}
name: ${{ matrix.emqx[1] }}
file: ${{ matrix.emqx[2] }}
- if: failure()
run: kubectl logs -l "control-plane=controller-manager" -n emqx-operator-system -c manager --tail=1000
- if: failure()
run: kubectl get ${{ matrix.emqx[0] }} ${{ matrix.emqx[1] }} -o json
- if: failure()
run: kubectl get events --sort-by='.lastTimestamp'
- if: failure()
run: kubectl logs -l "apps.emqx.io/managed-by=emqx-operator" -c emqx