Skip to content

Commit b4c462b

Browse files
committed
use path filters
1 parent 029795f commit b4c462b

File tree

4 files changed

+61
-16
lines changed

4 files changed

+61
-16
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
go_path: ${{ steps.vars.outputs.go_path }}
3333
min_k8s_version: ${{ steps.vars.outputs.min_k8s_version }}
3434
k8s_latest: ${{ steps.vars.outputs.k8s_latest }}
35-
helm_changes: ${{ steps.vars.outputs.helm_changes }}
35+
helm_changes: ${{ steps.filter.outputs.charts }}
3636
steps:
3737
- name: Checkout Repository
3838
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
@@ -44,22 +44,20 @@ jobs:
4444
with:
4545
go-version: stable
4646

47-
- name: Set up Python
48-
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
47+
- name: Check for changes
48+
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
49+
id: filter
4950
with:
50-
python-version: "3.x"
51-
check-latest: true
52-
53-
- name: Set up chart-testing
54-
uses: helm/chart-testing-action@e6669bcd63d7cb57cb4380c33043eebe5d111992 # v2.6.1
51+
filters: |
52+
charts:
53+
- charts/nginx-gateway-fabric/**/*
5554
5655
- name: Output Variables
5756
id: vars
5857
run: |
5958
echo "go_path=$(go env GOPATH)" >> $GITHUB_OUTPUT
6059
echo "min_k8s_version=v1.25.16" >> $GITHUB_OUTPUT
6160
echo "k8s_latest=$(grep -m1 'FROM kindest/node' <tests/Dockerfile | awk -F'[:]' '{print $2}')" >> $GITHUB_OUTPUT
62-
echo "helm_changes=$(ct list-changed --config .ct.yaml)" >> $GITHUB_OUTPUT
6361
6462
- name: Check if go.mod and go.sum are up to date
6563
run: go mod tidy && git diff --exit-code -- go.mod go.sum
@@ -263,7 +261,8 @@ jobs:
263261
with:
264262
image: ${{ matrix.image }}
265263
k8s-version: ${{ matrix.k8s-version }}
266-
if: ${{ needs.vars.outputs.helm_changes || github.event_name == 'schedule' }}
264+
secrets: inherit
265+
if: ${{ needs.vars.outputs.helm_changes == 'true' || github.event_name == 'schedule' }}
267266

268267
publish-helm:
269268
name: Package and Publish Helm Chart

.github/workflows/conformance.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,13 @@ jobs:
138138
ngf_tag=${{ steps.ngf-meta.outputs.version }}
139139
if [ ${{ github.event_name }} == "schedule" ]; then export GW_API_VERSION=main; fi
140140
if [ ${{ inputs.enable-experimental }} == "true" ]; then export ENABLE_EXPERIMENTAL=true; fi
141-
make install-local${{ inputs.image == 'plus' && '-with-plus' || ''}} PREFIX=${ngf_prefix} TAG=${ngf_tag}
141+
make helm-install-local${{ inputs.image == 'plus' && '-with-plus' || ''}} PREFIX=${ngf_prefix} TAG=${ngf_tag}
142142
make deploy-updated-provisioner PREFIX=${ngf_prefix} TAG=${ngf_tag}
143143
working-directory: ./tests
144144

145145
- name: Run conformance tests
146146
run: |
147-
make run-conformance-tests CONFORMANCE_TAG=${{ github.sha }} NGF_VERSION=${{ github.ref_name }}
147+
make run-conformance-tests CONFORMANCE_TAG=${{ github.sha }} NGF_VERSION=${{ github.ref_name }} CLUSTER_NAME=${{ github.run_id }}
148148
core_result=$(cat conformance-profile.yaml | yq '.profiles[0].core.result')
149149
extended_result=$(cat conformance-profile.yaml | yq '.profiles[0].extended.result')
150150
if [ "${core_result}" == "failure" ] || [ "${extended_result}" == "failure" ]; then echo "Conformance test failed, see above for details." && exit 2; fi

.github/workflows/helm.yml

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ permissions:
1414
contents: read
1515

1616
jobs:
17-
helm-tests:
18-
name: Helm Tests
17+
helm-tests-local:
18+
name: Helm Tests Local
1919
runs-on: ubuntu-22.04
2020
if: ${{ github.event_name != 'schedule' }}
2121
steps:
@@ -115,3 +115,48 @@ jobs:
115115
--set=nginxGateway.image.pullPolicy=Never \
116116
--set=nginx.image.pullPolicy=Never \
117117
--set=nginxGateway.productTelemetry.enable=false"
118+
119+
helm-test-remote:
120+
name: Helm Tests Remote
121+
runs-on: ubuntu-22.04
122+
# if: ${{ github.event_name == 'schedule' }}
123+
steps:
124+
- name: Checkout Repository
125+
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
126+
with:
127+
fetch-depth: 0
128+
129+
- name: Install cloud-provider-kind
130+
run: go install sigs.k8s.io/cloud-provider-kind@latest
131+
132+
- name: Run cloud-provider-kind
133+
run: ~/go/bin/cloud-provider-kind & > cloud-provider-kind.log 2>&1
134+
135+
- name: Deploy Kubernetes
136+
id: k8s
137+
run: |
138+
kind create cluster --name ${{ github.run_id }} --image=kindest/node:${{ inputs.k8s-version }}
139+
kubectl kustomize config/crd/gateway-api/standard | kubectl apply -f -
140+
kubectl create namespace nginx-gateway
141+
142+
- name: Create k8s secret
143+
if: ${{ inputs.image == 'plus' }}
144+
run: |
145+
kubectl create secret docker-registry nginx-plus-registry-secret --docker-server=private-registry.nginx.com --docker-username=${{ secrets.JWT_PLUS_REGISTRY }} --docker-password=none -n nginx-gateway
146+
147+
- name: Set up Python
148+
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
149+
with:
150+
python-version: "3.x"
151+
check-latest: true
152+
153+
- name: Set up chart-testing
154+
uses: helm/chart-testing-action@e6669bcd63d7cb57cb4380c33043eebe5d111992 # v2.6.1
155+
156+
- name: Install Chart
157+
run: |
158+
ct install --config .ct.yaml --all --namespace nginx-gateway --helm-extra-set-args="--set=nginxGateway.image.tag=nightly \
159+
--set=nginx.plus=${{ inputs.image == 'plus' }} \
160+
--set=nginx.image.tag=nightly \
161+
--set=nginxGateway.productTelemetry.enable=false \
162+
${{ inputs.image == 'plus' && '--set=nginx.image.pullSecret=nginx-plus-registry-secret --set=nginx.image.repository=private-registry.nginx.com/nginx-gateway-fabric/nginx-plus' || '' }}"

tests/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
CI=false
2+
CLUSTER_NAME ?= kind
23
CONFORMANCE_PREFIX = conformance-test-runner## Prefix for the conformance test runner image
34
CONFORMANCE_TAG = latest## Tag for the conformance test runner image
45
GATEWAY_CLASS = nginx## Gateway class to use
@@ -10,7 +11,7 @@ GW_SERVICE_TYPE=NodePort## Service type to use for the gateway
1011
GW_SVC_GKE_INTERNAL=false
1112
K8S_VERSION ?= latest## Kubernetes version to use. Expected format: 1.24 (major.minor) or latest
1213
NGF_VERSION ?= $(shell git describe --tags $(shell git rev-list --tags --max-count=1))## NGF version to be tested (defaults to latest tag)
13-
PULL_POLICY=Never## Pull policy for the images
14+
PULL_POLICY = Never## Pull policy for the images
1415
PROVISIONER_MANIFEST = conformance/provisioner/provisioner.yaml
1516
SUPPORTED_FEATURES = HTTPRouteQueryParamMatching,HTTPRouteMethodMatching,HTTPRoutePortRedirect,HTTPRouteSchemeRedirect,HTTPRouteHostRewrite,HTTPRoutePathRewrite,GatewayPort8080,HTTPRouteResponseHeaderModification,GRPCExactMethodMatching,GRPCRouteListenerHostnameMatching,GRPCRouteHeaderMatching
1617

@@ -29,7 +30,7 @@ build-test-runner-image: ## Build conformance test runner image
2930

3031
.PHONY: run-conformance-tests
3132
run-conformance-tests: ## Run conformance tests
32-
kind load docker-image $(CONFORMANCE_PREFIX):$(CONFORMANCE_TAG)
33+
kind load docker-image $(CONFORMANCE_PREFIX):$(CONFORMANCE_TAG) --name $(CLUSTER_NAME)
3334
kubectl apply -f conformance/conformance-rbac.yaml
3435
kubectl run -i conformance \
3536
--image=$(CONFORMANCE_PREFIX):$(CONFORMANCE_TAG) --image-pull-policy=Never \

0 commit comments

Comments
 (0)