Skip to content
This repository has been archived by the owner on Nov 2, 2023. It is now read-only.

archive yurt-app-manager #76

archive yurt-app-manager

archive yurt-app-manager #76

Workflow file for this run

name: E2E Test
on:
push:
branches:
- master
- release-*
tags:
- v*
workflow_dispatch: {}
pull_request:
branches:
- master
- release-*
env:
# Common versions
GO_VERSION: '1.17'
KIND_CLUSTER_NAME: 'kind'
KIND_VERSION: 'v0.14.0'
KIND_IMAGE_VERSION: '[\"v1.22.9\"]'
KIND_IMAGE_VERSIONS: '[\"v1.22.9\"]'
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@v4.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
paths_ignore: '["**.md", "**.mdx", "**.png", "**.jpg"]'
do_not_skip: '["workflow_dispatch", "schedule", "push"]'
concurrent_skipping: false
set-k8s-matrix:
runs-on: ubuntu-20.04
outputs:
matrix: ${{ steps.set-k8s-matrix.outputs.matrix }}
steps:
- id: set-k8s-matrix
run: |
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
echo "pushing tag: ${{ github.ref_name }}"
echo "::set-output name=matrix::${{ env.KIND_IMAGE_VERSIONS }}"
else
echo "::set-output name=matrix::${{ env.KIND_IMAGE_VERSION }}"
fi
e2e-multi-cluster-tests:
runs-on: ubuntu-20.04
needs: [ detect-noop,set-k8s-matrix ]
if: needs.detect-noop.outputs.noop != 'true'
strategy:
matrix:
k8s-version: ${{ fromJson(needs.set-k8s-matrix.outputs.matrix) }}
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Get dependencies
run: |
go get -v -t -d ./...
mkdir -p ${GITHUB_WORKSPACE}
cp ./tests/kind-conf.yaml ${GITHUB_WORKSPACE}/kind-conf.yaml
- name: Setup Kind Cluster
uses: engineerd/setup-kind@v0.5.0
with:
image: kindest/node:${{ matrix.k8s-version }}
version: ${{ env.KIND_VERSION }}
config: kind-conf.yaml
name: ${{ env.KIND_CLUSTER_NAME }}
- name: Load Image to kind cluster
run: |
kubectl version
kubectl cluster-info
IMAGE_TAG=latest TARGET_PLATFORMS=linux/amd64 GIT_VERSION=e2e-test make kind-load
- name: Prepare for e2e tests
run: |
helm install -n kube-system yurt-app-manager ./charts/yurt-app-manager --timeout 5m
- name: Run e2e tests
run: make e2e-test
# TODO implement e2e profile
# - name: Upload coverage report
# uses: codecov/codecov-action@v1
# 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