mirror of
https://github.com/kubevela/kubevela.git
synced 2026-08-23 22:46:53 +00:00
Signed-off-by: basefas <basefas@hotmail.com> Signed-off-by: basefas <basefas@hotmail.com>
129 lines
3.6 KiB
YAML
129 lines
3.6 KiB
YAML
name: E2E MultiCluster Test
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
- release-*
|
|
tags:
|
|
- v*
|
|
workflow_dispatch: {}
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
- release-*
|
|
|
|
env:
|
|
# Common versions
|
|
GO_VERSION: '1.19'
|
|
GOLANGCI_VERSION: 'v1.49'
|
|
|
|
jobs:
|
|
|
|
detect-noop:
|
|
runs-on: ubuntu-20.04
|
|
outputs:
|
|
noop: ${{ steps.noop.outputs.should_skip }}
|
|
steps:
|
|
- name: Detect No-op Changes
|
|
id: noop
|
|
uses: fkirc/skip-duplicate-actions@v5
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
paths_ignore: '["**.md", "**.mdx", "**.png", "**.jpg"]'
|
|
do_not_skip: '["workflow_dispatch", "schedule", "push"]'
|
|
continue-on-error: true
|
|
|
|
e2e-multi-cluster-tests:
|
|
runs-on: aliyun
|
|
needs: [ detect-noop ]
|
|
if: needs.detect-noop.outputs.noop != 'true'
|
|
strategy:
|
|
matrix:
|
|
k8s-version: ["v1.20","v1.24"]
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.k8s-version }}
|
|
cancel-in-progress: true
|
|
|
|
|
|
steps:
|
|
- name: Check out code into the Go module directory
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v3
|
|
with:
|
|
go-version: ${{ env.GO_VERSION }}
|
|
|
|
- name: Get dependencies
|
|
run: |
|
|
go get -v -t -d ./...
|
|
|
|
- name: Tear down K3d if exist
|
|
run: |
|
|
k3d cluster delete || true
|
|
k3d cluster delete worker || true
|
|
|
|
- name: Calculate K3d args
|
|
run: |
|
|
EGRESS_ARG=""
|
|
if [[ "${{ matrix.k8s-version }}" == v1.24 ]]; then
|
|
EGRESS_ARG="--k3s-arg --egress-selector-mode=disabled@server:0"
|
|
fi
|
|
echo "EGRESS_ARG=${EGRESS_ARG}" >> $GITHUB_ENV
|
|
|
|
- name: Setup K3d (Hub)
|
|
uses: nolar/setup-k3d-k3s@v1.0.9
|
|
with:
|
|
version: ${{ matrix.k8s-version }}
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
k3d-args: ${{ env.EGRESS_ARG }}
|
|
|
|
- name: Setup K3d (Worker)
|
|
uses: nolar/setup-k3d-k3s@v1.0.9
|
|
with:
|
|
version: ${{ matrix.k8s-version }}
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
k3d-name: worker
|
|
k3d-args: --kubeconfig-update-default=false --network=k3d-k3s-default ${{ env.EGRESS_ARG }}
|
|
|
|
- name: Generating internal worker kubeconfig
|
|
run: |
|
|
internal_ip=$(docker network inspect k3d-k3s-default|jq ".[0].Containers"| jq -r '.[]| select(.Name=="k3d-worker-server-0")|.IPv4Address' | cut -d/ -f1)
|
|
k3d kubeconfig get worker > /tmp/worker.client.kubeconfig
|
|
cp /tmp/worker.client.kubeconfig /tmp/worker.kubeconfig
|
|
sed -i "s/0.0.0.0:[0-9]\+/$internal_ip:6443/" /tmp/worker.kubeconfig
|
|
|
|
- name: Load image to k3d cluster (hub and worker)
|
|
run: make image-load image-load-runtime-cluster
|
|
|
|
- name: Cleanup for e2e tests
|
|
run: |
|
|
make vela-cli
|
|
make e2e-cleanup
|
|
make e2e-setup-core-auth
|
|
make setup-runtime-e2e-cluster
|
|
|
|
- name: Run e2e multicluster tests
|
|
run: |
|
|
export PATH=$(pwd)/bin:$PATH
|
|
make e2e-multicluster-test
|
|
|
|
- name: Stop kubevela, get profile
|
|
run: make end-e2e-core
|
|
|
|
- name: Upload coverage report
|
|
uses: codecov/codecov-action@v3
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
files: /tmp/e2e-profile.out,/tmp/e2e_multicluster_test.out
|
|
flags: e2e-multicluster-test
|
|
name: codecov-umbrella
|
|
|
|
- name: Clean e2e profile
|
|
run: rm /tmp/e2e-profile.out
|
|
|
|
- name: Cleanup image
|
|
if: ${{ always() }}
|
|
run: make image-cleanup
|