Update conformance test name #2813
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Conformance Testing | ||
|
Check failure on line 1 in .github/workflows/conformance.yml
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| image: | ||
| required: true | ||
| type: string | ||
| build_os: | ||
| required: false | ||
| type: string | ||
| default: '' | ||
| k8s-version: | ||
| required: true | ||
| type: string | ||
| enable-experimental: | ||
| required: true | ||
| type: boolean | ||
| production-release: | ||
| required: false | ||
| type: boolean | ||
| default: false | ||
| release_version: | ||
| required: false | ||
| type: string | ||
| default: '' | ||
| defaults: | ||
| run: | ||
| shell: bash | ||
| env: | ||
| PLUS_USAGE_ENDPOINT: ${{ secrets.JWT_PLUS_REPORTING_ENDPOINT }} | ||
| ENABLE_EXPERIMENTAL: ${{ inputs.enable-experimental }} | ||
| permissions: | ||
| contents: read | ||
| jobs: | ||
| conformance-tests: | ||
| name: Run Tests | ||
| runs-on: ubuntu-24.04 | ||
| if: ${{ !github.event.pull_request.head.repo.fork || inputs.image != 'plus' }} | ||
| permissions: | ||
| contents: write # needed for uploading release artifacts | ||
| env: | ||
| DOCKER_BUILD_SUMMARY: false | ||
| steps: | ||
| - name: Checkout Repository | ||
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Configure GOPROXY | ||
| id: goproxy | ||
| run: | | ||
| if [[ "${{ secrets.ARTIFACTORY_USER }}" == "" ]]; then | ||
| GOPROXY_VALUE="direct" | ||
| else | ||
| GOPROXY_VALUE="https://${{ secrets.ARTIFACTORY_USER }}:${{ secrets.ARTIFACTORY_TOKEN }}@${{ secrets.ARTIFACTORY_DEV_ENDPOINT }}" | ||
| fi | ||
| echo "GOPROXY=${GOPROXY_VALUE}" >> $GITHUB_ENV | ||
| - name: Setup Golang Environment | ||
| uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 | ||
| with: | ||
| go-version: stable | ||
| - name: Set GOPATH | ||
| run: echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV | ||
| - name: Docker Buildx | ||
| uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 | ||
| - name: NGF Docker meta | ||
| id: ngf-meta | ||
| uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0 | ||
| with: | ||
| images: | | ||
| name=ghcr.io/nginx/nginx-gateway-fabric | ||
| tags: | | ||
| type=semver,pattern={{version}},suffix=${{ inputs.build_os != '' && format('-{0}', inputs.build_os) || '' }} | ||
| type=edge,suffix=${{ inputs.build_os != '' && format('-{0}', inputs.build_os) || '' }} | ||
| type=schedule,suffix=${{ inputs.build_os != '' && format('-{0}', inputs.build_os) || '' }} | ||
| type=ref,event=pr,suffix=${{ inputs.build_os != '' && format('-{0}', inputs.build_os) || '' }} | ||
| type=ref,event=branch,suffix=-rc${{ inputs.build_os != '' && format('-{0}', inputs.build_os) || '' }},enable=${{ startsWith(github.ref, 'refs/heads/release') && inputs.tag == '' }} | ||
| type=raw,value=${{ inputs.tag }},enable=${{ inputs.tag != '' }},suffix=${{ inputs.build_os != '' && format('-{0}', inputs.build_os) || '' }} | ||
| - name: NGINX Docker meta | ||
| id: nginx-meta | ||
| uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0 | ||
| with: | ||
| images: | | ||
| name=ghcr.io/nginx/nginx-gateway-fabric/${{ inputs.image == 'plus' && 'nginx-plus' || inputs.image }} | ||
| tags: | | ||
| type=semver,pattern={{version}},suffix=${{ inputs.build_os != '' && format('-{0}', inputs.build_os) || '' }} | ||
| type=edge,suffix=${{ inputs.build_os != '' && format('-{0}', inputs.build_os) || '' }} | ||
| type=schedule,suffix=${{ inputs.build_os != '' && format('-{0}', inputs.build_os) || '' }} | ||
| type=ref,event=pr,suffix=${{ inputs.build_os != '' && format('-{0}', inputs.build_os) || '' }} | ||
| type=ref,event=branch,suffix=-rc${{ inputs.build_os != '' && format('-{0}', inputs.build_os) || '' }},enable=${{ startsWith(github.ref, 'refs/heads/release') && inputs.tag == '' }} | ||
| type=raw,value=${{ inputs.tag }},enable=${{ inputs.tag != '' }},suffix=${{ inputs.build_os != '' && format('-{0}', inputs.build_os) || '' }} | ||
| - name: Build binary | ||
| uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0 | ||
| with: | ||
| version: v2.12.2 # renovate: datasource=github-tags depName=goreleaser/goreleaser | ||
| args: build --single-target --snapshot --clean | ||
| env: | ||
| TELEMETRY_ENDPOINT: "" # disables sending telemetry | ||
| TELEMETRY_ENDPOINT_INSECURE: "false" | ||
| - name: Build NGF Docker Image | ||
| uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 | ||
| with: | ||
| file: build/Dockerfile | ||
| tags: ${{ steps.ngf-meta.outputs.tags }} | ||
| context: "." | ||
| target: goreleaser | ||
| load: true | ||
| cache-from: type=gha,scope=ngf | ||
| pull: true | ||
| - name: Build NGINX Docker Image | ||
| uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 | ||
| with: | ||
| file: build/Dockerfile${{ inputs.image == 'nginx' && '.nginx' || '' }}${{ inputs.image == 'plus' && '.nginxplus' || ''}} | ||
| tags: ${{ steps.nginx-meta.outputs.tags }} | ||
| context: "." | ||
| load: true | ||
| cache-from: type=gha,scope=${{ inputs.image }} | ||
| pull: true | ||
| build-args: | | ||
| NJS_DIR=internal/controller/nginx/modules/src | ||
| NGINX_CONF_DIR=internal/controller/nginx/conf | ||
| BUILD_AGENT=gha | ||
| - name: Update Go Modules | ||
| if: ${{ github.event_name == 'schedule' }} | ||
| run: make update-go-modules | ||
| working-directory: ./tests | ||
| - name: Build Test Docker Image | ||
| uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 | ||
| with: | ||
| file: tests/conformance/Dockerfile | ||
| tags: conformance-test-runner:${{ github.sha }} | ||
| context: "tests" | ||
| load: true | ||
| cache-from: type=gha | ||
| cache-to: type=gha,mode=max | ||
| pull: true | ||
| - name: Deploy Kubernetes | ||
| id: k8s | ||
| run: | | ||
| kind create cluster --name ${{ github.run_id }} --image=kindest/node:${{ inputs.k8s-version }} | ||
| kind load docker-image ${{ join(fromJSON(steps.ngf-meta.outputs.json).tags, ' ') }} ${{ join(fromJSON(steps.nginx-meta.outputs.json).tags, ' ') }} --name ${{ github.run_id }} | ||
| - name: Setup license file for plus | ||
| if: ${{ inputs.image == 'plus' }} | ||
| env: | ||
| PLUS_LICENSE: ${{ secrets.JWT_PLUS_EXCEPTION_REPORTING }} | ||
| run: echo "${PLUS_LICENSE}" > license.jwt | ||
| - name: Setup conformance tests | ||
| run: | | ||
| ngf_prefix=ghcr.io/nginx/nginx-gateway-fabric | ||
| ngf_tag=${{ steps.ngf-meta.outputs.version }} | ||
| if [ ${{ github.event_name }} == "schedule" ]; then export GW_API_VERSION=main; fi | ||
| make helm-install-local${{ inputs.image == 'plus' && '-with-plus' || ''}} PREFIX=${ngf_prefix} TAG=${ngf_tag} | ||
| working-directory: ./tests | ||
| - name: Run conformance tests | ||
| run: | | ||
| make run-conformance-tests CONFORMANCE_TAG=${{ github.sha }} NGF_VERSION=${{ github.ref_name }} CLUSTER_NAME=${{ github.run_id }} | ||
| core_result=$(cat conformance-profile.yaml | yq '.profiles[0].core.result') | ||
| extended_result=$(cat conformance-profile.yaml | yq '.profiles[0].extended.result') | ||
| if [ "${core_result}" == "failure" ] || [ "${extended_result}" == "failure" ]; then echo "Conformance test failed, see above for details." && exit 2; fi | ||
| working-directory: ./tests | ||
| - name: Upload profile to GitHub | ||
| if: ${{ inputs.enable-experimental }} | ||
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | ||
| with: | ||
| name: conformance-profile-${{ inputs.image }}-${{ inputs.k8s-version }}${{ inputs.build_os != '' && format('-{0}', inputs.build_os) || '' }-${{ inputs.enable-experimental }} | ||
| path: ./tests/conformance-profile.yaml | ||
| - name: Upload profile to release | ||
| if: ${{ inputs.production-release && inputs.enable-experimental }} | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: gh release upload ${{ github.ref_name }} conformance-profile.yaml --clobber | ||
| working-directory: ./tests | ||