Merge branch 'feat/openshift-support' into chore/module-dir #137
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: Functional Testing | ||
on: | ||
workflow_call: | ||
inputs: | ||
image: | ||
required: true | ||
type: string | ||
k8s-version: | ||
required: true | ||
type: string | ||
build-os: | ||
required: false | ||
type: string | ||
default: '' | ||
defaults: | ||
run: | ||
shell: bash | ||
env: | ||
PLUS_USAGE_ENDPOINT: ${{ secrets.JWT_PLUS_REPORTING_ENDPOINT }} | ||
permissions: | ||
contents: read | ||
jobs: | ||
functional-tests: | ||
name: Run Tests | ||
runs-on: ubuntu-24.04 | ||
if: ${{ !github.event.pull_request.head.repo.fork || inputs.image != 'plus' }} | ||
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=schedule,suffix=${{ inputs.build-os != '' && format('-{0}', inputs.build-os) || '' }} | ||
type=edge,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') }} | ||
- 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=schedule,suffix=${{ inputs.build-os != '' && format('-{0}', inputs.build-os) || '' }} | ||
type=edge,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') }} | ||
- name: Build binary | ||
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0 | ||
with: | ||
<<<<<<< HEAD | ||
version: v2.12.3 # renovate: datasource=github-tags depName=goreleaser/goreleaser | ||
======= | ||
version: v2.12.4 # renovate: datasource=github-tags depName=goreleaser/goreleaser | ||
>>>>>>> feat/openshift-support | ||
args: build --single-target --snapshot --clean | ||
env: | ||
TELEMETRY_ENDPOINT: otel-collector-opentelemetry-collector.collector.svc.cluster.local:4317 | ||
TELEMETRY_ENDPOINT_INSECURE: "true" | ||
- 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: "." | ||
load: true | ||
cache-from: type=gha,scope=ngf | ||
pull: true | ||
target: goreleaser | ||
- name: Build NGINX Docker Image | ||
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 | ||
with: | ||
file: build${{ inputs.build-os != '' && format('/{0}', inputs.build-os) || '' }}/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 }}${{ inputs.build-os != '' && format('-{0}', inputs.build-os) || '' }} | ||
pull: true | ||
build-args: | | ||
NJS_DIR=internal/controller/nginx/modules/src | ||
NGINX_CONF_DIR=internal/controller/nginx/conf | ||
BUILD_AGENT=gha | ||
- name: Setup license file for plus | ||
if: ${{ inputs.image == 'plus' }} | ||
env: | ||
PLUS_LICENSE: ${{ secrets.JWT_PLUS_REPORTING }} | ||
run: echo "${PLUS_LICENSE}" > license.jwt | ||
- name: Install cloud-provider-kind | ||
run: | | ||
CLOUD_PROVIDER_KIND_VERSION=v0.7.0 # renovate: datasource=github-tags depName=kubernetes-sigs/cloud-provider-kind | ||
go install sigs.k8s.io/cloud-provider-kind@${CLOUD_PROVIDER_KIND_VERSION} | ||
- name: Run cloud-provider-kind | ||
run: $(go env GOPATH)/bin/cloud-provider-kind & > cloud-provider-kind.log 2>&1 | ||
- 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: Run functional telemetry tests | ||
run: | | ||
ngf_prefix=ghcr.io/nginx/nginx-gateway-fabric | ||
ngf_tag=${{ steps.ngf-meta.outputs.version }} | ||
make test${{ inputs.image == 'plus' && '-with-plus' || ''}} PREFIX=${ngf_prefix} TAG=${ngf_tag} GINKGO_LABEL=telemetry GW_SERVICE_TYPE=LoadBalancer CLUSTER_NAME=${{ github.run_id }} CI=true | ||
working-directory: ./tests | ||
- name: Run functional graceful-recovery tests | ||
run: | | ||
ngf_prefix=ghcr.io/nginx/nginx-gateway-fabric | ||
ngf_tag=${{ steps.ngf-meta.outputs.version }} | ||
make test${{ inputs.image == 'plus' && '-with-plus' || ''}} PREFIX=${ngf_prefix} TAG=${ngf_tag} GINKGO_LABEL=graceful-recovery GW_SERVICE_TYPE=LoadBalancer CLUSTER_NAME=${{ github.run_id }} CI=true | ||
working-directory: ./tests | ||
- name: Run functional tests | ||
run: | | ||
ngf_prefix=ghcr.io/nginx/nginx-gateway-fabric | ||
ngf_tag=${{ steps.ngf-meta.outputs.version }} | ||
make test${{ inputs.image == 'plus' && '-with-plus' || ''}} PREFIX=${ngf_prefix} TAG=${ngf_tag} GW_SERVICE_TYPE=LoadBalancer CLUSTER_NAME=${{ github.run_id }} CI=true | ||
working-directory: ./tests |