|
| 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: Conformance Test |
| 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.22" |
| 47 | + |
| 48 | + - name: Install kind |
| 49 | + run: | |
| 50 | + go install sigs.k8s.io/[email protected] |
| 51 | +
|
| 52 | + - name: Install Helm |
| 53 | + run: | |
| 54 | + curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 |
| 55 | + chmod 700 get_helm.sh |
| 56 | + ./get_helm.sh |
| 57 | +
|
| 58 | + conformance-test: |
| 59 | + timeout-minutes: 60 |
| 60 | + needs: |
| 61 | + - prepare |
| 62 | + runs-on: buildjet-2vcpu-ubuntu-2204 |
| 63 | + steps: |
| 64 | + - name: Checkout |
| 65 | + uses: actions/checkout@v4 |
| 66 | + with: |
| 67 | + submodules: recursive |
| 68 | + |
| 69 | + - name: Setup Go Env |
| 70 | + uses: actions/setup-go@v4 |
| 71 | + with: |
| 72 | + go-version: "1.22" |
| 73 | + |
| 74 | + - name: Login to Private Registry |
| 75 | + uses: docker/login-action@v1 |
| 76 | + with: |
| 77 | + registry: hkccr.ccs.tencentyun.com |
| 78 | + username: ${{ secrets.PRIVATE_DOCKER_USERNAME }} |
| 79 | + password: ${{ secrets.PRIVATE_DOCKER_PASSWORD }} |
| 80 | + |
| 81 | + - name: Build images |
| 82 | + env: |
| 83 | + TAG: dev |
| 84 | + ARCH: amd64 |
| 85 | + ENABLE_PROXY: "false" |
| 86 | + BASE_IMAGE_TAG: "debug" |
| 87 | + run: | |
| 88 | + echo "building images..." |
| 89 | + make build-image |
| 90 | +
|
| 91 | + - name: Launch Kind Cluster |
| 92 | + run: | |
| 93 | + make kind-up |
| 94 | +
|
| 95 | + - name: Install And Run Cloud Provider KIND |
| 96 | + run: | |
| 97 | + go install sigs.k8s.io/cloud-provider-kind@latest |
| 98 | + nohup cloud-provider-kind > /tmp/kind-loadbalancer.log 2>&1 & |
| 99 | + |
| 100 | + - name: Install Gateway API And CRDs |
| 101 | + run: | |
| 102 | + make install |
| 103 | +
|
| 104 | + - name: Loading Docker Image to Kind Cluster |
| 105 | + run: | |
| 106 | + make kind-load-images |
| 107 | +
|
| 108 | + - name: Install API7EE3 |
| 109 | + run: | |
| 110 | + make download-api7ee3-chart |
| 111 | +
|
| 112 | + - name: Run Conformance Test |
| 113 | + shell: bash |
| 114 | + env: |
| 115 | + API7_EE_LICENSE: ${{ secrets.API7_EE_LICENSE }} |
| 116 | + continue-on-error: true |
| 117 | + run: | |
| 118 | + make conformance-test |
| 119 | + |
| 120 | + - name: Get Logs from api7-ingress-controller |
| 121 | + shell: bash |
| 122 | + run: | |
| 123 | + export KUBECONFIG=/tmp/apisix-ingress-cluster.kubeconfig |
| 124 | + kubectl logs -n apisix-conformance-test -l app=apisix-ingress-controller |
| 125 | +
|
| 126 | + - name: Upload Gateway API Conformance Report |
| 127 | + if: ${{ github.event_name == 'push' }} |
| 128 | + uses: actions/upload-artifact@v4 |
| 129 | + with: |
| 130 | + name: apisix-ingress-controller-conformance-report.yaml |
| 131 | + path: apisix-ingress-controller-conformance-report.yaml |
| 132 | + |
| 133 | + - name: Format Conformance Test Report |
| 134 | + if: ${{ github.event_name == 'pull_request' }} |
| 135 | + run: | |
| 136 | + echo '# conformance test report' > report.md |
| 137 | + echo '```yaml' >> report.md |
| 138 | + cat apisix-ingress-controller-conformance-report.yaml >> report.md |
| 139 | + echo '```' >> report.md |
| 140 | +
|
| 141 | + - name: Report Conformance Test Result to PR Comment |
| 142 | + if: ${{ github.event_name == 'pull_request' }} |
| 143 | + uses: mshick/add-pr-comment@v2 |
| 144 | + with: |
| 145 | + message-id: 'conformance-test-report' |
| 146 | + message-path: | |
| 147 | + report.md |
0 commit comments