|
| 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: APISIX E2E Test 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 | + prepare: |
| 36 | + name: Prepare |
| 37 | + runs-on: buildjet-2vcpu-ubuntu-2204 |
| 38 | + steps: |
| 39 | + - name: Checkout |
| 40 | + uses: actions/checkout@v4 |
| 41 | + |
| 42 | + - name: Setup Go Env |
| 43 | + id: go |
| 44 | + uses: actions/setup-go@v4 |
| 45 | + with: |
| 46 | + go-version: "1.23" |
| 47 | + |
| 48 | + - name: Install kind |
| 49 | + run: | |
| 50 | + go install sigs.k8s.io/[email protected] |
| 51 | +
|
| 52 | + e2e-test: |
| 53 | + needs: |
| 54 | + - prepare |
| 55 | + strategy: |
| 56 | + matrix: |
| 57 | + provider_type: |
| 58 | + - apisix-standalone |
| 59 | + - apisix |
| 60 | + cases_subset: |
| 61 | + - apisix.apache.org |
| 62 | + - networking.k8s.io |
| 63 | + fail-fast: false |
| 64 | + runs-on: buildjet-2vcpu-ubuntu-2204 |
| 65 | + steps: |
| 66 | + - name: Checkout |
| 67 | + uses: actions/checkout@v4 |
| 68 | + with: |
| 69 | + submodules: recursive |
| 70 | + |
| 71 | + - name: Setup Go Env |
| 72 | + uses: actions/setup-go@v4 |
| 73 | + with: |
| 74 | + go-version: "1.23" |
| 75 | + |
| 76 | + - name: Login to Registry |
| 77 | + uses: docker/login-action@v1 |
| 78 | + with: |
| 79 | + registry: ${{ secrets.DOCKER_REGISTRY }} |
| 80 | + username: ${{ secrets.DOCKER_USERNAME }} |
| 81 | + password: ${{ secrets.DOCKER_PASSWORD }} |
| 82 | + |
| 83 | + - name: Build images |
| 84 | + env: |
| 85 | + TAG: dev |
| 86 | + ARCH: amd64 |
| 87 | + ENABLE_PROXY: "false" |
| 88 | + BASE_IMAGE_TAG: "debug" |
| 89 | + ADC_VERSION: "dev" |
| 90 | + run: | |
| 91 | + echo "building images..." |
| 92 | + make build-image |
| 93 | +
|
| 94 | + - name: Extract adc binary |
| 95 | + run: | |
| 96 | + echo "Extracting adc binary..." |
| 97 | + docker create --name adc-temp api7/api7-ingress-controller:dev |
| 98 | + docker cp adc-temp:/bin/adc /usr/local/bin/adc |
| 99 | + docker rm adc-temp |
| 100 | + chmod +x /usr/local/bin/adc |
| 101 | + echo "ADC binary extracted to /usr/local/bin/adc" |
| 102 | +
|
| 103 | + - name: Launch Kind Cluster |
| 104 | + env: |
| 105 | + KIND_NAME: apisix-ingress-cluster |
| 106 | + KIND_NODE_IMAGE: kindest/node:v1.18.20@sha256:38a8726ece5d7867fb0ede63d718d27ce2d41af519ce68be5ae7fcca563537ed |
| 107 | + run: | |
| 108 | + kind create cluster --name |
| 109 | +
|
| 110 | + - name: Loading Docker Image to Kind Cluster |
| 111 | + run: | |
| 112 | + make kind-load-ingress-image |
| 113 | +
|
| 114 | + - name: Install Gateway API And CRDs |
| 115 | + run: | |
| 116 | + make install |
| 117 | +
|
| 118 | + - name: Run E2E test suite |
| 119 | + shell: bash |
| 120 | + env: |
| 121 | + TEST_DIR: "./test/e2e/apisix/" |
| 122 | + PROVIDER_TYPE: ${{ matrix.provider_type }} |
| 123 | + TEST_LABEL: ${{ matrix.cases_subset }} |
| 124 | + run: | |
| 125 | + make e2e-test |
0 commit comments