Compatibility Test Suite #4358
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Compatibility Test Suite | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 */6 * * *' | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
kubernetes-env: | |
- minikube | |
- k3s | |
kubernetes-version: | |
- "v1.20.0" | |
- "v1.21.0" | |
- "v1.22.0" | |
- "v1.23.0" | |
- "v1.24.0" | |
- "v1.25.0" | |
- "v1.26.0" | |
- "v1.27.0" | |
- "v1.28.0" | |
- "v1.29.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@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'go.mod' | |
- 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 | |
build-image: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: docker/setup-buildx-action@v3 | |
- uses: docker/setup-qemu-action@v3 | |
with: | |
image: tonistiigi/binfmt:latest | |
platforms: all | |
- uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ github.token }} | |
- uses: docker/metadata-action@v5 | |
id: meta | |
with: | |
images: ghcr.io/${{ github.repository_owner }}/emqx-operator | |
flavor: | | |
latest=true | |
tags: | | |
type=ref,event=branch | |
type=ref,event=tag | |
type=semver,pattern={{version}} | |
- uses: docker/build-push-action@v5 | |
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: | |
## Set max parallel to 8 to avoid hitting the GitHub Actions concurrency limit | |
max-parallel: 8 | |
fail-fast: false | |
matrix: | |
kubernetes-env: | |
- minikube | |
- k3s | |
kubernetes-version: | |
- "v1.20.0" | |
- "v1.21.0" | |
- "v1.22.0" | |
- "v1.23.0" | |
- "v1.24.0" | |
- "v1.25.0" | |
- "v1.26.0" | |
- "v1.27.0" | |
- "v1.28.0" | |
- "v1.29.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@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'go.mod' | |
- name: Deploy operator | |
timeout-minutes: 5 | |
uses: ./.github/actions/deploy-operator | |
with: | |
repository: ghcr.io/${{ github.repository_owner }}/emqx-operator | |
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] }} | |
- name: Make sure all of pods can be deleted | |
run: | | |
kubectl delete ${{ matrix.emqx[0] }} ${{ matrix.emqx[1] }} | |
kubectl wait --for=delete pods -l "apps.emqx.io/instance=${{ matrix.emqx[1] }}" --timeout=300s | |
- 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 get pods -l "apps.emqx.io/managed-by=emqx-operator" -o json | |
- if: failure() | |
run: kubectl logs -l "apps.emqx.io/managed-by=emqx-operator" -c emqx |