|
| 1 | +# Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +# or more contributor license agreements. See the NOTICE file |
| 3 | +# distributed with this work for additional information |
| 4 | +# regarding copyright ownership. The ASF licenses this file |
| 5 | +# to you under the Apache License, Version 2.0 (the |
| 6 | +# "License"); you may not use this file except in compliance |
| 7 | +# with the License. You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, |
| 12 | +# software distributed under the License is distributed on an |
| 13 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +# KIND, either express or implied. See the License for the |
| 15 | +# specific language governing permissions and limitations |
| 16 | +# under the License. |
| 17 | + |
| 18 | +name: E2E Test For Kubernetes |
| 19 | + |
| 20 | +on: |
| 21 | + push: |
| 22 | + branches: |
| 23 | + - master |
| 24 | + - release-v2-dev |
| 25 | + pull_request: |
| 26 | + branches: |
| 27 | + - master |
| 28 | + - release-v2-dev |
| 29 | + |
| 30 | +concurrency: |
| 31 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
| 32 | + cancel-in-progress: true |
| 33 | + |
| 34 | +jobs: |
| 35 | + e2e-test: |
| 36 | + strategy: |
| 37 | + matrix: |
| 38 | + cases_subset: |
| 39 | + - v2 |
| 40 | + runs-on: buildjet-2vcpu-ubuntu-2004 |
| 41 | + steps: |
| 42 | + - name: Checkout |
| 43 | + uses: actions/checkout@v2 |
| 44 | + with: |
| 45 | + submodules: recursive |
| 46 | + |
| 47 | + - name: Setup Go Env |
| 48 | + uses: actions/setup-go@v4 |
| 49 | + with: |
| 50 | + go-version: "1.23" |
| 51 | + |
| 52 | + - name: Install kind |
| 53 | + run: | |
| 54 | + go install sigs.k8s.io/[email protected] |
| 55 | +
|
| 56 | + - name: Install Helm |
| 57 | + run: | |
| 58 | + curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 |
| 59 | + chmod 700 get_helm.sh |
| 60 | + ./get_helm.sh |
| 61 | +
|
| 62 | + - name: Login to Registry |
| 63 | + uses: docker/login-action@v1 |
| 64 | + with: |
| 65 | + registry: ${{ secrets.DOCKER_REGISTRY }} |
| 66 | + username: ${{ secrets.DOCKER_USERNAME }} |
| 67 | + password: ${{ secrets.DOCKER_PASSWORD }} |
| 68 | + |
| 69 | + - name: Login to Private Registry |
| 70 | + uses: docker/login-action@v1 |
| 71 | + with: |
| 72 | + registry: hkccr.ccs.tencentyun.com |
| 73 | + username: ${{ secrets.PRIVATE_DOCKER_USERNAME }} |
| 74 | + password: ${{ secrets.PRIVATE_DOCKER_PASSWORD }} |
| 75 | + |
| 76 | + - name: Launch Kind Cluster |
| 77 | + env: |
| 78 | + KIND_NODE_IMAGE: kindest/node:v1.18.20@sha256:38a8726ece5d7867fb0ede63d718d27ce2d41af519ce68be5ae7fcca563537ed |
| 79 | + run: | |
| 80 | + make kind-up |
| 81 | +
|
| 82 | + - name: Build images |
| 83 | + env: |
| 84 | + TAG: dev |
| 85 | + ARCH: amd64 |
| 86 | + ENABLE_PROXY: "false" |
| 87 | + BASE_IMAGE_TAG: "debug" |
| 88 | + run: | |
| 89 | + echo "building images..." |
| 90 | + make build-image |
| 91 | +
|
| 92 | + - name: Extract adc binary |
| 93 | + run: | |
| 94 | + echo "Extracting adc binary..." |
| 95 | + docker create --name adc-temp api7/api7-ingress-controller:dev |
| 96 | + docker cp adc-temp:/bin/adc /usr/local/bin/adc |
| 97 | + docker rm adc-temp |
| 98 | + chmod +x /usr/local/bin/adc |
| 99 | + echo "ADC binary extracted to /usr/local/bin/adc" |
| 100 | +
|
| 101 | + - name: Install v2 CRDs |
| 102 | + run: | |
| 103 | + make install-crds-nocel |
| 104 | +
|
| 105 | + - name: Download API7EE3 Chart |
| 106 | + run: | |
| 107 | + make download-api7ee3-chart |
| 108 | +
|
| 109 | + - name: Loading Docker Image to Kind Cluster |
| 110 | + run: | |
| 111 | + make kind-load-images |
| 112 | +
|
| 113 | + - name: Run E2E test suite |
| 114 | + shell: bash |
| 115 | + env: |
| 116 | + API7_EE_LICENSE: ${{ secrets.API7_EE_LICENSE }} |
| 117 | + PROVIDER_TYPE: api7ee |
| 118 | + TEST_LABEL: ${{ matrix.cases_subset }} |
| 119 | + INGRESS_VERSION: v1beta1 |
| 120 | + TEST_ENV: CI |
| 121 | + run: | |
| 122 | + make e2e-test |
0 commit comments