From a8d789597610b3c49fc1e3c739025a2c2ba52deb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charles-Edouard=20Br=C3=A9t=C3=A9ch=C3=A9?= Date: Wed, 13 Nov 2024 22:57:21 -0700 Subject: [PATCH 01/38] feat: add chainsaw based e2e tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Charles-Edouard Brétéché --- .github/workflows/ci.yaml | 11 ++++++++ Makefile | 6 +++++ tests/chainsaw/finalizers/chainsaw-test.yaml | 21 +++++++++++++++ tests/chainsaw/finalizers/ingress.yaml | 24 +++++++++++++++++ tests/chainsaw/sanity-checks/agent-pod.yaml | 13 +++++++++ .../chainsaw/sanity-checks/chainsaw-test.yaml | 27 +++++++++++++++++++ .../chainsaw/sanity-checks/ingress-class.yaml | 6 +++++ .../ngrok-operator-credentials.yaml | 9 +++++++ .../ngrok-operator-manager-config.yaml | 16 +++++++++++ .../chainsaw/sanity-checks/operator-pod.yaml | 13 +++++++++ 10 files changed, 146 insertions(+) create mode 100644 tests/chainsaw/finalizers/chainsaw-test.yaml create mode 100644 tests/chainsaw/finalizers/ingress.yaml create mode 100644 tests/chainsaw/sanity-checks/agent-pod.yaml create mode 100644 tests/chainsaw/sanity-checks/chainsaw-test.yaml create mode 100644 tests/chainsaw/sanity-checks/ingress-class.yaml create mode 100644 tests/chainsaw/sanity-checks/ngrok-operator-credentials.yaml create mode 100644 tests/chainsaw/sanity-checks/ngrok-operator-manager-config.yaml create mode 100644 tests/chainsaw/sanity-checks/operator-pod.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 641464fd..9fde1380 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -153,6 +153,17 @@ jobs: kubectl get nodes kubectl get pods -A + - name: Install cosign + uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da # v3.7.0 + - name: Install chainsaw + uses: kyverno/action-install-chainsaw@d311eacde764f806c9658574ff64c9c3b21f8397 # v0.2.11 + with: + verify: true + + - name: Run e2e tests + run: | + make chainsaw-tests + helm: runs-on: ubuntu-latest timeout-minutes: 15 diff --git a/Makefile b/Makefile index b2872395..1b8809e1 100644 --- a/Makefile +++ b/Makefile @@ -277,3 +277,9 @@ helm-update-snapshots: _helm_setup ## Update helm unittest snapshots helm-update-snapshots-no-deps: ## Update helm unittest snapshots without rebuilding dependencies $(MAKE) -C $(HELM_CHART_DIR) update-snapshots + +##@ Chainsaw + +.PHONY: chainsaw-tests +chainsaw-tests: ## Run chainsaw tests + chainsaw test ./tests/chainsaw diff --git a/tests/chainsaw/finalizers/chainsaw-test.yaml b/tests/chainsaw/finalizers/chainsaw-test.yaml new file mode 100644 index 00000000..2ef3598e --- /dev/null +++ b/tests/chainsaw/finalizers/chainsaw-test.yaml @@ -0,0 +1,21 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/kyverno/chainsaw/main/.schemas/json/test-chainsaw-v1alpha1.json +apiVersion: chainsaw.kyverno.io/v1alpha1 +kind: Test +metadata: + name: finalizers +spec: + steps: + - name: create an ingress + try: + - create: + file: ./ingress.yaml + - name: verify finalizers + try: + - assert: + resource: + apiVersion: networking.k8s.io/v1 + kind: Ingress + metadata: + name: minimal-ingress-https + finalizers: + - k8s.ngrok.com/finalizer diff --git a/tests/chainsaw/finalizers/ingress.yaml b/tests/chainsaw/finalizers/ingress.yaml new file mode 100644 index 00000000..b7516209 --- /dev/null +++ b/tests/chainsaw/finalizers/ingress.yaml @@ -0,0 +1,24 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: minimal-ingress-https +spec: + ingressClassName: ngrok + rules: + - host: foo.bar.com + http: + paths: + - path: /https-echo-plain + pathType: Prefix + backend: + service: + name: https-echo-svc + port: + number: 80 + - path: /https-echo-tls + pathType: Prefix + backend: + service: + name: https-echo-svc + port: + number: 443 diff --git a/tests/chainsaw/sanity-checks/agent-pod.yaml b/tests/chainsaw/sanity-checks/agent-pod.yaml new file mode 100644 index 00000000..1d4e0304 --- /dev/null +++ b/tests/chainsaw/sanity-checks/agent-pod.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Pod +metadata: + labels: + app.kubernetes.io/component: agent + namespace: ngrok-operator +status: + (conditions[?type == 'Ready']): + - status: "True" + ~.containerStatuses: + ready: true + restartCount: 0 + phase: Running diff --git a/tests/chainsaw/sanity-checks/chainsaw-test.yaml b/tests/chainsaw/sanity-checks/chainsaw-test.yaml new file mode 100644 index 00000000..e2ae8244 --- /dev/null +++ b/tests/chainsaw/sanity-checks/chainsaw-test.yaml @@ -0,0 +1,27 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/kyverno/chainsaw/main/.schemas/json/test-chainsaw-v1alpha1.json +apiVersion: chainsaw.kyverno.io/v1alpha1 +kind: Test +metadata: + name: sanity-checks +spec: + steps: + - name: check ingress class exists + try: + - assert: + file: ./ingress-class.yaml + - name: check credentials exist + try: + - assert: + file: ./ngrok-operator-credentials.yaml + - name: check operator manager config + try: + - assert: + file: ./ngrok-operator-manager-config.yaml + - name: check operator pods are running + try: + - assert: + file: ./operator-pod.yaml + - name: check agent pods are running + try: + - assert: + file: ./agent-pod.yaml diff --git a/tests/chainsaw/sanity-checks/ingress-class.yaml b/tests/chainsaw/sanity-checks/ingress-class.yaml new file mode 100644 index 00000000..eca19ece --- /dev/null +++ b/tests/chainsaw/sanity-checks/ingress-class.yaml @@ -0,0 +1,6 @@ +apiVersion: networking.k8s.io/v1 +kind: IngressClass +metadata: + name: ngrok +spec: + controller: k8s.ngrok.com/ingress-controller diff --git a/tests/chainsaw/sanity-checks/ngrok-operator-credentials.yaml b/tests/chainsaw/sanity-checks/ngrok-operator-credentials.yaml new file mode 100644 index 00000000..566c5bc8 --- /dev/null +++ b/tests/chainsaw/sanity-checks/ngrok-operator-credentials.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: Secret +metadata: + name: ngrok-operator-credentials + namespace: ngrok-operator +type: Opaque +data: + API_KEY: {} + AUTHTOKEN: {} diff --git a/tests/chainsaw/sanity-checks/ngrok-operator-manager-config.yaml b/tests/chainsaw/sanity-checks/ngrok-operator-manager-config.yaml new file mode 100644 index 00000000..b29a2c4b --- /dev/null +++ b/tests/chainsaw/sanity-checks/ngrok-operator-manager-config.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: ngrok-operator-manager-config + namespace: ngrok-operator +data: + controller_manager_config.yaml: | + apiVersion: controller-runtime.sigs.k8s.io/v1alpha1 + kind: ControllerManagerConfig + health: + healthProbeBindAddress: :8081 + metrics: + bindAddress: 127.0.0.1:8080 + leaderElection: + leaderElect: true + resourceName: ngrok-operator-leader diff --git a/tests/chainsaw/sanity-checks/operator-pod.yaml b/tests/chainsaw/sanity-checks/operator-pod.yaml new file mode 100644 index 00000000..2ae589c9 --- /dev/null +++ b/tests/chainsaw/sanity-checks/operator-pod.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Pod +metadata: + labels: + app.kubernetes.io/component: controller + namespace: ngrok-operator +status: + (conditions[?type == 'Ready']): + - status: "True" + ~.containerStatuses: + ready: true + restartCount: 0 + phase: Running From f2d7e997c31989ae03e2eefd84a525440e520e36 Mon Sep 17 00:00:00 2001 From: Harrison Katz Date: Fri, 15 Nov 2024 11:00:19 -0500 Subject: [PATCH 02/38] Add kyverno-chainsaw from nixpkgs:unstable to flake.nix --- flake.lock | 12 ++++++------ flake.nix | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index c0137b3a..324c54e6 100644 --- a/flake.lock +++ b/flake.lock @@ -5,11 +5,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", "owner": "numtide", "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", "type": "github" }, "original": { @@ -20,11 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1724395761, - "narHash": "sha256-zRkDV/nbrnp3Y8oCADf5ETl1sDrdmAW6/bBVJ8EbIdQ=", + "lastModified": 1731531548, + "narHash": "sha256-sz8/v17enkYmfpgeeuyzniGJU0QQBfmAjlemAUYhfy8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ae815cee91b417be55d43781eb4b73ae1ecc396c", + "rev": "24f0d4acd634792badd6470134c387a3b039dace", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index f481eb1f..8f238164 100644 --- a/flake.nix +++ b/flake.nix @@ -19,6 +19,7 @@ kubebuilder jq yq + kyverno-chainsaw ]; }; })); From 733375c61d059fa15769cfdccff910b11a57ec0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charles-Edouard=20Br=C3=A9t=C3=A9ch=C3=A9?= Date: Fri, 15 Nov 2024 09:28:18 -0700 Subject: [PATCH 03/38] rename make target MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Charles-Edouard Brétéché --- .github/workflows/ci.yaml | 2 +- Makefile | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9fde1380..8f8ed8d2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -162,7 +162,7 @@ jobs: - name: Run e2e tests run: | - make chainsaw-tests + make e2e-tests helm: runs-on: ubuntu-latest diff --git a/Makefile b/Makefile index 1b8809e1..b32b9884 100644 --- a/Makefile +++ b/Makefile @@ -278,8 +278,8 @@ helm-update-snapshots: _helm_setup ## Update helm unittest snapshots helm-update-snapshots-no-deps: ## Update helm unittest snapshots without rebuilding dependencies $(MAKE) -C $(HELM_CHART_DIR) update-snapshots -##@ Chainsaw +##@ E2E tests -.PHONY: chainsaw-tests -chainsaw-tests: ## Run chainsaw tests +.PHONY: e2e-tests +e2e-tests: ## Run e2e tests chainsaw test ./tests/chainsaw From 6d3903fdb2bbf2eaa336aeea0123cc1a8cfde1f1 Mon Sep 17 00:00:00 2001 From: Harrison Katz Date: Fri, 22 Nov 2024 10:32:34 -0500 Subject: [PATCH 04/38] spacing formatting --- tests/chainsaw/finalizers/chainsaw-test.yaml | 2 +- tests/chainsaw/sanity-checks/chainsaw-test.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/chainsaw/finalizers/chainsaw-test.yaml b/tests/chainsaw/finalizers/chainsaw-test.yaml index 2ef3598e..b04cb421 100644 --- a/tests/chainsaw/finalizers/chainsaw-test.yaml +++ b/tests/chainsaw/finalizers/chainsaw-test.yaml @@ -4,7 +4,7 @@ kind: Test metadata: name: finalizers spec: - steps: + steps: - name: create an ingress try: - create: diff --git a/tests/chainsaw/sanity-checks/chainsaw-test.yaml b/tests/chainsaw/sanity-checks/chainsaw-test.yaml index e2ae8244..e6f4fb75 100644 --- a/tests/chainsaw/sanity-checks/chainsaw-test.yaml +++ b/tests/chainsaw/sanity-checks/chainsaw-test.yaml @@ -4,7 +4,7 @@ kind: Test metadata: name: sanity-checks spec: - steps: + steps: - name: check ingress class exists try: - assert: From 5fc9a33d23c8aaa50078fd8cb4b0dd9b8579e681 Mon Sep 17 00:00:00 2001 From: Harrison Katz Date: Fri, 22 Nov 2024 10:42:45 -0500 Subject: [PATCH 05/38] Add specific deploy target for e2e tests --- .github/workflows/ci.yaml | 10 +++++++++- Makefile | 22 ++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8f8ed8d2..3b4b15f4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -146,7 +146,15 @@ jobs: run: make docker-build - name: Deploy controller to local cluster - run: make deploy NGROK_API_KEY=fake-ci-key NGROK_AUTHTOKEN=fake-ci-token + run: | + # create some namespaces for bindings tests + kubectl create ns e2e || true + + # deploy ngrok-op for e2e tests + make deploy_for_e2e \ + NGROK_API_KEY="{{ secrets.NGROK_CI_API_KEY }}" \ + NGROK_AUTHTOKEN="{{ secrets.NGROK_CI_AUTHTOKEN }}" \ + E2E_BINDING_NAME="e2e-{{ env.GITHUB_RUN_ID }}" \ - name: Check if controller is up run: | diff --git a/Makefile b/Makefile index b32b9884..f4c2d966 100644 --- a/Makefile +++ b/Makefile @@ -190,6 +190,28 @@ deploy_with_bindings: _deploy-check-env-vars docker-build manifests kustomize _h &&\ kubectl rollout restart deployment $(KUBE_DEPLOYMENT_NAME) -n $(KUBE_NAMESPACE) +.PHONY: deploy_for_e2e +deploy_for_e2e: _deploy-check-env-vars docker-build manifests kustomize _helm_setup ## Deploy controller to the K8s cluster specified in ~/.kube/config. + helm upgrade $(HELM_RELEASE_NAME) $(HELM_CHART_DIR) --install \ + --namespace $(KUBE_NAMESPACE) \ + --create-namespace \ + --set image.repository=$(IMG) \ + --set image.tag="latest" \ + --set podAnnotations."k8s\.ngrok\.com/test"="\{\"env\": \"e2e\"\}" \ + --set credentials.apiKey=$(NGROK_API_KEY) \ + --set credentials.authtoken=$(NGROK_AUTHTOKEN) \ + --set log.format=console \ + --set log.level=debug \ + --set log.stacktraceLevel=panic \ + --set metaData.env=local,metaData.from=makefile \ + --set bindings.enabled=true \ + --set bindings.name=$(E2E_BINDING_NAME) \ + --set bindings.description="Example binding for CI e2e tests" \ + --set bindings.allowedURLs="{*.e2e}" \ + --set bindings.serviceAnnotations.annotation1="val1" \ + --set bindings.serviceAnnotations.annotation2="val2" \ + --set bindings.serviceLabels.label1="val1" \ + .PHONY: _deploy-check-env-vars _deploy-check-env-vars: ifndef NGROK_API_KEY From 5a6f16a792a35d35f0cad1dc4e887d1d03d9d7f8 Mon Sep 17 00:00:00 2001 From: Harrison Katz Date: Fri, 22 Nov 2024 10:43:07 -0500 Subject: [PATCH 06/38] Rename job to build-and-test --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3b4b15f4..da881f73 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -106,7 +106,7 @@ jobs: - run: git diff --exit-code go.sum - build: + build-and-test: runs-on: ubuntu-latest needs: - changes From a1af691c37eec488337a52532e144c8c961740cd Mon Sep 17 00:00:00 2001 From: Harrison Katz Date: Fri, 22 Nov 2024 10:51:55 -0500 Subject: [PATCH 07/38] Add tests/ dir to changes detection --- .github/workflows/ci.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index da881f73..67d1cbb6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -43,6 +43,8 @@ jobs: - 'Dockerfile' - 'scripts/e2e.sh' - 'VERSION' + tests: + - 'test/**' tag: - 'VERSION' From e99bcb09f53084832a7fd652a3ba7bad2e161cac Mon Sep 17 00:00:00 2001 From: Harrison Katz Date: Fri, 22 Nov 2024 10:55:05 -0500 Subject: [PATCH 08/38] Add Makefile to changes detection --- .github/workflows/ci.yaml | 2 ++ Makefile | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 67d1cbb6..650b46a6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -45,6 +45,8 @@ jobs: - 'VERSION' tests: - 'test/**' + make: + - 'Makefile' tag: - 'VERSION' diff --git a/Makefile b/Makefile index f4c2d966..1450d850 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,3 @@ - # Image URL to use all building/pushing image targets IMG ?= ngrok-operator From 2e482adba381d272f253caea99662369687bea8e Mon Sep 17 00:00:00 2001 From: Harrison Katz Date: Fri, 22 Nov 2024 10:58:39 -0500 Subject: [PATCH 09/38] Trigger Makefile changes --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 1450d850..2f4bdc0a 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,7 @@ IMG ?= ngrok-operator # ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary. ENVTEST_K8S_VERSION = 1.29.0 +# Repo Url REPO_URL = github.com/ngrok/ngrok-operator # Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) From deeeaa63ccbe6c0a01a31f7291abbe704ca9ccfa Mon Sep 17 00:00:00 2001 From: Harrison Katz Date: Fri, 22 Nov 2024 11:01:50 -0500 Subject: [PATCH 10/38] Update changes outputs --- .github/workflows/ci.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 650b46a6..a311aca6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -18,6 +18,8 @@ jobs: chartyaml: ${{ steps.filter.outputs.chartyaml }} go: ${{ steps.filter.outputs.go }} tag: ${{ steps.filter.outputs.tag }} + tests: ${{ steps.filter.outputs.tests }} + make: ${{ steps.filter.outputs.make }} permissions: contents: read pull-requests: read From cc1f59478c3a99298d33e3d8e73a285d8bb7d8f9 Mon Sep 17 00:00:00 2001 From: Harrison Katz Date: Fri, 22 Nov 2024 11:02:13 -0500 Subject: [PATCH 11/38] Trigger change in Makefile --- Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile b/Makefile index 2f4bdc0a..1450d850 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,6 @@ IMG ?= ngrok-operator # ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary. ENVTEST_K8S_VERSION = 1.29.0 -# Repo Url REPO_URL = github.com/ngrok/ngrok-operator # Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) From a510747d89aa6fea96d92c0aa5e1d026c5a7bcb3 Mon Sep 17 00:00:00 2001 From: Harrison Katz Date: Fri, 22 Nov 2024 11:04:55 -0500 Subject: [PATCH 12/38] Update changes triggers for build-and-test --- .github/workflows/ci.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a311aca6..12fb6dda 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -119,7 +119,10 @@ jobs: - kubebuilder-diff if: | (needs.changes.outputs.go == 'true') || - (needs.changes.outputs.charts == 'true') + (needs.changes.outputs.charts == 'true') || + (needs.changes.outputs.chartyaml == 'true') || + (needs.changes.outputs.tests == 'true') || + (needs.changes.outputs.make == 'true') steps: - uses: actions/checkout@v3 From 01e5f1e85987ecf6f79e5a775dbc9e2b4a3e3700 Mon Sep 17 00:00:00 2001 From: Harrison Katz Date: Fri, 22 Nov 2024 11:05:07 -0500 Subject: [PATCH 13/38] Trigger Makefile changes --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 1450d850..2f4bdc0a 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,7 @@ IMG ?= ngrok-operator # ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary. ENVTEST_K8S_VERSION = 1.29.0 +# Repo Url REPO_URL = github.com/ngrok/ngrok-operator # Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) From 76473d48f80885e661ab165818b72c0937c1c84f Mon Sep 17 00:00:00 2001 From: Harrison Katz Date: Fri, 22 Nov 2024 11:15:40 -0500 Subject: [PATCH 14/38] Adjust make target --- .github/workflows/ci.yaml | 2 +- Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 12fb6dda..135857f5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -163,7 +163,7 @@ jobs: make deploy_for_e2e \ NGROK_API_KEY="{{ secrets.NGROK_CI_API_KEY }}" \ NGROK_AUTHTOKEN="{{ secrets.NGROK_CI_AUTHTOKEN }}" \ - E2E_BINDING_NAME="e2e-{{ env.GITHUB_RUN_ID }}" \ + E2E_BINDING_NAME="k8s/e2e-{{ env.GITHUB_RUN_ID }}" \ - name: Check if controller is up run: | diff --git a/Makefile b/Makefile index 2f4bdc0a..4962f2e8 100644 --- a/Makefile +++ b/Makefile @@ -210,7 +210,7 @@ deploy_for_e2e: _deploy-check-env-vars docker-build manifests kustomize _helm_se --set bindings.allowedURLs="{*.e2e}" \ --set bindings.serviceAnnotations.annotation1="val1" \ --set bindings.serviceAnnotations.annotation2="val2" \ - --set bindings.serviceLabels.label1="val1" \ + --set bindings.serviceLabels.label1="val1" .PHONY: _deploy-check-env-vars _deploy-check-env-vars: From 9482f872bb2f9e5338a193ca830a42faf32933d7 Mon Sep 17 00:00:00 2001 From: Harrison Katz Date: Fri, 22 Nov 2024 11:24:51 -0500 Subject: [PATCH 15/38] Adjust make target --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4962f2e8..51f31a6e 100644 --- a/Makefile +++ b/Makefile @@ -207,7 +207,7 @@ deploy_for_e2e: _deploy-check-env-vars docker-build manifests kustomize _helm_se --set bindings.enabled=true \ --set bindings.name=$(E2E_BINDING_NAME) \ --set bindings.description="Example binding for CI e2e tests" \ - --set bindings.allowedURLs="{*.e2e}" \ + --set bindings.allowedURLs='{*.e2e}' \ --set bindings.serviceAnnotations.annotation1="val1" \ --set bindings.serviceAnnotations.annotation2="val2" \ --set bindings.serviceLabels.label1="val1" From 87de8bad9d369e86f68195045fbdfe8040b438e7 Mon Sep 17 00:00:00 2001 From: Harrison Katz Date: Fri, 22 Nov 2024 12:17:28 -0500 Subject: [PATCH 16/38] Adjust ci envars --- .github/workflows/ci.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 135857f5..bcd6ca05 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -155,15 +155,16 @@ jobs: run: make docker-build - name: Deploy controller to local cluster + env: + NGROK_API_KEY: ${{ secrets.NGROK_CI_API_KEY }} + NGROK_AUTHTOKEN: ${{ secrets.NGROK_CI_AUTHTOKEN }} + E2E_BINDING_NAME: k8s/e2e-${{ env.GITHUB_RUN_ID }} run: | # create some namespaces for bindings tests kubectl create ns e2e || true # deploy ngrok-op for e2e tests - make deploy_for_e2e \ - NGROK_API_KEY="{{ secrets.NGROK_CI_API_KEY }}" \ - NGROK_AUTHTOKEN="{{ secrets.NGROK_CI_AUTHTOKEN }}" \ - E2E_BINDING_NAME="k8s/e2e-{{ env.GITHUB_RUN_ID }}" \ + make deploy_for_e2e - name: Check if controller is up run: | From d68ec47141bfaa36e3a126f604a7a61a888a1815 Mon Sep 17 00:00:00 2001 From: Harrison Katz Date: Fri, 22 Nov 2024 12:17:38 -0500 Subject: [PATCH 17/38] Trigger change in Makefile --- Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile b/Makefile index 51f31a6e..2d8c4b5d 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,6 @@ IMG ?= ngrok-operator # ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary. ENVTEST_K8S_VERSION = 1.29.0 -# Repo Url REPO_URL = github.com/ngrok/ngrok-operator # Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) From 77333f9390651517ebcae91da6522a7e9171be97 Mon Sep 17 00:00:00 2001 From: Harrison Katz Date: Fri, 22 Nov 2024 12:37:46 -0500 Subject: [PATCH 18/38] Change workflows to trigger on both the main repo and branch repo --- .github/workflows/ci.yaml | 10 ++++++++++ Makefile | 8 ++++++++ 2 files changed, 18 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index bcd6ca05..c16ed513 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -4,6 +4,8 @@ on: branches: [ "main" ] pull_request: branches: [ "main" ] + pull_request_target: + branches: [ "main" ] env: GO_VERSION: '1.23' @@ -179,9 +181,17 @@ jobs: verify: true - name: Run e2e tests + if: "github.repository == 'ngrok/ngrok-operator'" run: | make e2e-tests + # best effort to remove ngrok k8s resources from cluster + # this allows our finalizers to delete upstream ngrok API resources too + # that hopefully helps not pollute our ngrok-operator-ci account + - name: Cleanup e2e tests + run: | + make e2e-clean + helm: runs-on: ubuntu-latest timeout-minutes: 15 diff --git a/Makefile b/Makefile index 2d8c4b5d..b459378f 100644 --- a/Makefile +++ b/Makefile @@ -304,3 +304,11 @@ helm-update-snapshots-no-deps: ## Update helm unittest snapshots without rebuild .PHONY: e2e-tests e2e-tests: ## Run e2e tests chainsaw test ./tests/chainsaw + +.PHONY: e2e-clean +e2e-clean: ## Clean up e2e tests + kubectl delete ns e2e + kubectl delete --all boundendpoints -n ngrok-operator + kubectl delete --all services -n ngrok-operator + kubectl delete --all kubernetesoperators -n ngrok-operator + helm uninstall ngrok-operator From 152e2cc6ed72931849f5db1f5087322eade85f17 Mon Sep 17 00:00:00 2001 From: Harrison Katz Date: Fri, 22 Nov 2024 13:01:01 -0500 Subject: [PATCH 19/38] Add fake-api-key and fake-authtoken where necesarry --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c16ed513..1740baab 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -158,8 +158,8 @@ jobs: - name: Deploy controller to local cluster env: - NGROK_API_KEY: ${{ secrets.NGROK_CI_API_KEY }} - NGROK_AUTHTOKEN: ${{ secrets.NGROK_CI_AUTHTOKEN }} + NGROK_API_KEY: ${{ github.repository == 'ngrok/ngrok-operator' && secrets.NGROK_CI_API_KEY || 'fake-api-key' }} + NGROK_AUTHTOKEN: ${{ github.repository == 'ngrok/ngrok-operator' && secrets.NGROK_CI_AUTHTOKEN || 'fake-authtoken' }} E2E_BINDING_NAME: k8s/e2e-${{ env.GITHUB_RUN_ID }} run: | # create some namespaces for bindings tests From 89e8fbfafd28eac81d79b2ffc55f0966772ac3c5 Mon Sep 17 00:00:00 2001 From: Harrison Katz Date: Fri, 22 Nov 2024 13:17:06 -0500 Subject: [PATCH 20/38] Use correct variable --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1740baab..d841081c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -160,7 +160,7 @@ jobs: env: NGROK_API_KEY: ${{ github.repository == 'ngrok/ngrok-operator' && secrets.NGROK_CI_API_KEY || 'fake-api-key' }} NGROK_AUTHTOKEN: ${{ github.repository == 'ngrok/ngrok-operator' && secrets.NGROK_CI_AUTHTOKEN || 'fake-authtoken' }} - E2E_BINDING_NAME: k8s/e2e-${{ env.GITHUB_RUN_ID }} + E2E_BINDING_NAME: k8s/e2e-${{ github.run_id }} run: | # create some namespaces for bindings tests kubectl create ns e2e || true From 41657b3661691b57549009c777c7a38c8283acf8 Mon Sep 17 00:00:00 2001 From: Harrison Katz Date: Fri, 22 Nov 2024 13:38:35 -0500 Subject: [PATCH 21/38] Try with no quotes --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d841081c..4b7d6593 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -181,7 +181,7 @@ jobs: verify: true - name: Run e2e tests - if: "github.repository == 'ngrok/ngrok-operator'" + if: github.repository == 'ngrok/ngrok-operator' run: | make e2e-tests From 9839386c024327546d42f5e8cc0af6c1e98cebb7 Mon Sep 17 00:00:00 2001 From: Harrison Katz Date: Mon, 25 Nov 2024 10:42:34 -0500 Subject: [PATCH 22/38] Separate out composite actions --- .github/workflows/action-build-and-test.yaml | 86 +++++++++++++++ .github/workflows/action-changes.yaml | 39 +++++++ .github/workflows/ci.yaml | 107 ++----------------- .github/workflows/test.yaml | 39 +++++++ Makefile | 6 ++ 5 files changed, 179 insertions(+), 98 deletions(-) create mode 100644 .github/workflows/action-build-and-test.yaml create mode 100644 .github/workflows/action-changes.yaml create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/action-build-and-test.yaml b/.github/workflows/action-build-and-test.yaml new file mode 100644 index 00000000..b3967089 --- /dev/null +++ b/.github/workflows/action-build-and-test.yaml @@ -0,0 +1,86 @@ +name: Action - Build and Test +description: "Build and test the operator (with optional e2e tests)" + +inputs: + run-e2e: + description: "Run e2e tests" + required: false + default: false + go-version: + description: "Go version to use" + required: false + default: "${{ env.GO_VERSION }}" + +runs: + using: "composite" + steps: + - uses: actions/checkout@v3 + + - uses: debianmaster/actions-k3s@master + id: k3s + with: + version: 'latest' + - run: | + kubectl get nodes + kubectl get pods -A + + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: ${{ inputs.go-version }} + + - name: Build + run: make build + + - name: Lint + run: make lint + + - name: Setup Envtest + run: make envtest + + - name: Test + run: make test + + - name: Build the Docker image + run: make docker-build + + - name: Deploy controller to local cluster + env: + # deploy with 1-click demo mode when not running e2e tests + DEPLOY_ONE_CLICK_DEMO_MODE: ${{ inputs.run-e2e && 'false' || 'true' }} + NGROK_API_KEY: ${{ github.repository == 'ngrok/ngrok-operator' && secrets.NGROK_CI_API_KEY || 'fake-api-key' }} + NGROK_AUTHTOKEN: ${{ github.repository == 'ngrok/ngrok-operator' && secrets.NGROK_CI_AUTHTOKEN || 'fake-authtoken' }} + E2E_BINDING_NAME: k8s/e2e-${{ github.run_id }} + run: | + # create some namespaces for bindings tests + kubectl create ns e2e || true + + # deploy ngrok-op for e2e tests + make deploy_for_e2e + + - name: Check if controller is up + run: | + kubectl get nodes + kubectl get pods -A + + - name: Install cosign + if: inputs.run-e2e + uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da # v3.7.0 + - name: Install chainsaw + if: inputs.run-e2e + uses: kyverno/action-install-chainsaw@d311eacde764f806c9658574ff64c9c3b21f8397 # v0.2.11 + with: + verify: true + + - name: Run e2e tests + if: inputs.run-e2e + run: | + make e2e-tests + + # best effort to remove ngrok k8s resources from cluster + # this allows our finalizers to delete upstream ngrok API resources too + # that hopefully helps not pollute our ngrok-operator-ci account + - name: Cleanup e2e tests + if: inputs.run-e2e + run: | + make e2e-clean diff --git a/.github/workflows/action-changes.yaml b/.github/workflows/action-changes.yaml new file mode 100644 index 00000000..6086c2db --- /dev/null +++ b/.github/workflows/action-changes.yaml @@ -0,0 +1,39 @@ +name: Action - Changes +description: "Detect changes in the repository" + +outputs: + charts: ${{ steps.filter.outputs.charts }} + chartyaml: ${{ steps.filter.outputs.chartyaml }} + go: ${{ steps.filter.outputs.go }} + tag: ${{ steps.filter.outputs.tag }} + tests: ${{ steps.filter.outputs.tests }} + make: ${{ steps.filter.outputs.make }} + +runs: + using: "composite" + steps: + - id: filter + uses: dorny/paths-filter@v2.11.1 + with: + filters: | + chartyaml: + - 'helm/ngrok-operator/Chart.yaml' + charts: + - 'helm/ngrok-operator/**' + - 'scripts/e2e.sh' + go: + - '**.go' + - 'go.mod' + - 'go.sum' + - 'cmd/**' + - 'internal/**' + - 'pkg/**' + - 'Dockerfile' + - 'scripts/e2e.sh' + - 'VERSION' + tests: + - 'test/**' + make: + - 'Makefile' + tag: + - 'VERSION' diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4b7d6593..6e33b04d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -15,44 +15,11 @@ jobs: changes: runs-on: ubuntu-latest - outputs: - charts: ${{ steps.filter.outputs.charts }} - chartyaml: ${{ steps.filter.outputs.chartyaml }} - go: ${{ steps.filter.outputs.go }} - tag: ${{ steps.filter.outputs.tag }} - tests: ${{ steps.filter.outputs.tests }} - make: ${{ steps.filter.outputs.make }} permissions: contents: read pull-requests: read steps: - - name: Checkout repo - uses: actions/checkout@v3 - - id: filter - uses: dorny/paths-filter@v2.11.1 - with: - filters: | - chartyaml: - - 'helm/ngrok-operator/Chart.yaml' - charts: - - 'helm/ngrok-operator/**' - - 'scripts/e2e.sh' - go: - - '**.go' - - 'go.mod' - - 'go.sum' - - 'cmd/**' - - 'internal/**' - - 'pkg/**' - - 'Dockerfile' - - 'scripts/e2e.sh' - - 'VERSION' - tests: - - 'test/**' - make: - - 'Makefile' - tag: - - 'VERSION' + - uses: "ngrok/ngrok-operator/.github/workflows/action-changes.yaml@${{ github.sha }}" # Make sure that Kubebuilder autogenerated files are up to date. kubebuilder-diff: @@ -113,7 +80,6 @@ jobs: - run: git diff --exit-code go.mod - run: git diff --exit-code go.sum - build-and-test: runs-on: ubuntu-latest needs: @@ -125,73 +91,18 @@ jobs: (needs.changes.outputs.chartyaml == 'true') || (needs.changes.outputs.tests == 'true') || (needs.changes.outputs.make == 'true') + permissions: + contents: read + pull-requests: read steps: - - uses: actions/checkout@v3 - - - uses: debianmaster/actions-k3s@master - id: k3s - with: - version: 'latest' - - run: | - kubectl get nodes - kubectl get pods -A - - - name: Set up Go - uses: actions/setup-go@v3 + - uses: "ngrok/ngrok-operator/.github/workflows/action-build-and-test.yaml@${{ github.sha }}" with: + # this workflow is for incoming PRs, so we want to skip e2e tests + # and deploy the demo mode because our api keys are not available + # on contributor's forks + run-e2e: false go-version: ${{ env.GO_VERSION }} - - name: Build - run: make build - - - name: Lint - run: make lint - - - name: Setup Envtest - run: make envtest - - - name: Test - run: make test - - - name: Build the Docker image - run: make docker-build - - - name: Deploy controller to local cluster - env: - NGROK_API_KEY: ${{ github.repository == 'ngrok/ngrok-operator' && secrets.NGROK_CI_API_KEY || 'fake-api-key' }} - NGROK_AUTHTOKEN: ${{ github.repository == 'ngrok/ngrok-operator' && secrets.NGROK_CI_AUTHTOKEN || 'fake-authtoken' }} - E2E_BINDING_NAME: k8s/e2e-${{ github.run_id }} - run: | - # create some namespaces for bindings tests - kubectl create ns e2e || true - - # deploy ngrok-op for e2e tests - make deploy_for_e2e - - - name: Check if controller is up - run: | - kubectl get nodes - kubectl get pods -A - - - name: Install cosign - uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da # v3.7.0 - - name: Install chainsaw - uses: kyverno/action-install-chainsaw@d311eacde764f806c9658574ff64c9c3b21f8397 # v0.2.11 - with: - verify: true - - - name: Run e2e tests - if: github.repository == 'ngrok/ngrok-operator' - run: | - make e2e-tests - - # best effort to remove ngrok k8s resources from cluster - # this allows our finalizers to delete upstream ngrok API resources too - # that hopefully helps not pollute our ngrok-operator-ci account - - name: Cleanup e2e tests - run: | - make e2e-clean - helm: runs-on: ubuntu-latest timeout-minutes: 15 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 00000000..deedb6d3 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,39 @@ +name: Tests +on: + push: + branches: [ "main" ] + pull_request_target: + branches: [ "main" ] + +env: + GO_VERSION: '1.23' + DOCKER_BUILDX_PLATFORMS: linux/amd64,linux/arm64 + +jobs: + changes: + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: read + steps: + - uses: "ngrok/ngrok-operator/.github/workflows/action-changes.yaml@${{ github.sha }}" + + build-and-test: + runs-on: ubuntu-latest + needs: + - changes + - kubebuilder-diff + if: | + (needs.changes.outputs.go == 'true') || + (needs.changes.outputs.charts == 'true') || + (needs.changes.outputs.chartyaml == 'true') || + (needs.changes.outputs.tests == 'true') || + (needs.changes.outputs.make == 'true') + permissions: + contents: read + pull-requests: read + steps: + - uses: "ngrok/ngrok-operator/.github/workflows/action-build-and-test.yaml@${{ github.sha }}" + with: + run-e2e: true + go-version: ${{ env.GO_VERSION }} diff --git a/Makefile b/Makefile index b459378f..fe16b477 100644 --- a/Makefile +++ b/Makefile @@ -31,6 +31,11 @@ HELM_TEMPLATES_DIR = $(HELM_CHART_DIR)/templates CONTROLLER_GEN_PATHS = {./api/..., ./internal/controller/...} +# Default Environment Variables + +# when true, deploy with --set oneClickDemoMode=true +DEPLOY_ONE_CLICK_DEMO_MODE ?= false + # Targets .PHONY: all @@ -194,6 +199,7 @@ deploy_for_e2e: _deploy-check-env-vars docker-build manifests kustomize _helm_se helm upgrade $(HELM_RELEASE_NAME) $(HELM_CHART_DIR) --install \ --namespace $(KUBE_NAMESPACE) \ --create-namespace \ + --set oneClickDemoMode=$(DEPLOY_ONE_CLICK_DEMO_MODE) \ --set image.repository=$(IMG) \ --set image.tag="latest" \ --set podAnnotations."k8s\.ngrok\.com/test"="\{\"env\": \"e2e\"\}" \ From 3440c3de868153a0da20ce8180e58f553e6e1b06 Mon Sep 17 00:00:00 2001 From: Harrison Katz Date: Mon, 25 Nov 2024 10:48:44 -0500 Subject: [PATCH 23/38] With proper directory --- .../build-and-test.yaml} | 1 - .../{workflows/action-changes.yaml => actions/changes.yaml} | 1 + .github/workflows/ci.yaml | 4 ++-- .github/workflows/test.yaml | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) rename .github/{workflows/action-build-and-test.yaml => actions/build-and-test.yaml} (99%) rename .github/{workflows/action-changes.yaml => actions/changes.yaml} (96%) diff --git a/.github/workflows/action-build-and-test.yaml b/.github/actions/build-and-test.yaml similarity index 99% rename from .github/workflows/action-build-and-test.yaml rename to .github/actions/build-and-test.yaml index b3967089..89ae91d2 100644 --- a/.github/workflows/action-build-and-test.yaml +++ b/.github/actions/build-and-test.yaml @@ -15,7 +15,6 @@ runs: using: "composite" steps: - uses: actions/checkout@v3 - - uses: debianmaster/actions-k3s@master id: k3s with: diff --git a/.github/workflows/action-changes.yaml b/.github/actions/changes.yaml similarity index 96% rename from .github/workflows/action-changes.yaml rename to .github/actions/changes.yaml index 6086c2db..bbf51a8b 100644 --- a/.github/workflows/action-changes.yaml +++ b/.github/actions/changes.yaml @@ -12,6 +12,7 @@ outputs: runs: using: "composite" steps: + - uses: actions/checkout@v3 - id: filter uses: dorny/paths-filter@v2.11.1 with: diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6e33b04d..7a21a022 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -19,7 +19,7 @@ jobs: contents: read pull-requests: read steps: - - uses: "ngrok/ngrok-operator/.github/workflows/action-changes.yaml@${{ github.sha }}" + - uses: "ngrok/ngrok-operator/.github/actions/changes.yaml@${{ github.sha }}" # Make sure that Kubebuilder autogenerated files are up to date. kubebuilder-diff: @@ -95,7 +95,7 @@ jobs: contents: read pull-requests: read steps: - - uses: "ngrok/ngrok-operator/.github/workflows/action-build-and-test.yaml@${{ github.sha }}" + - uses: "ngrok/ngrok-operator/.github/actions/build-and-test.yaml@${{ github.sha }}" with: # this workflow is for incoming PRs, so we want to skip e2e tests # and deploy the demo mode because our api keys are not available diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index deedb6d3..9a129836 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -16,7 +16,7 @@ jobs: contents: read pull-requests: read steps: - - uses: "ngrok/ngrok-operator/.github/workflows/action-changes.yaml@${{ github.sha }}" + - uses: "ngrok/ngrok-operator/.github/actions/changes.yaml@${{ github.sha }}" build-and-test: runs-on: ubuntu-latest @@ -33,7 +33,7 @@ jobs: contents: read pull-requests: read steps: - - uses: "ngrok/ngrok-operator/.github/workflows/action-build-and-test.yaml@${{ github.sha }}" + - uses: "ngrok/ngrok-operator/.github/actions/build-and-test.yaml@${{ github.sha }}" with: run-e2e: true go-version: ${{ env.GO_VERSION }} From e3673196077e2839971f005dcef502c69c0affa8 Mon Sep 17 00:00:00 2001 From: Harrison Katz Date: Mon, 25 Nov 2024 10:53:33 -0500 Subject: [PATCH 24/38] With local paths --- .github/workflows/ci.yaml | 4 ++-- .github/workflows/test.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7a21a022..6b507d73 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -19,7 +19,7 @@ jobs: contents: read pull-requests: read steps: - - uses: "ngrok/ngrok-operator/.github/actions/changes.yaml@${{ github.sha }}" + - uses: ".github/actions/changes.yaml" # Make sure that Kubebuilder autogenerated files are up to date. kubebuilder-diff: @@ -95,7 +95,7 @@ jobs: contents: read pull-requests: read steps: - - uses: "ngrok/ngrok-operator/.github/actions/build-and-test.yaml@${{ github.sha }}" + - uses: ".github/actions/build-and-test.yaml" with: # this workflow is for incoming PRs, so we want to skip e2e tests # and deploy the demo mode because our api keys are not available diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 9a129836..07f00f86 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -16,7 +16,7 @@ jobs: contents: read pull-requests: read steps: - - uses: "ngrok/ngrok-operator/.github/actions/changes.yaml@${{ github.sha }}" + - uses: ".github/actions/changes.yaml" build-and-test: runs-on: ubuntu-latest @@ -33,7 +33,7 @@ jobs: contents: read pull-requests: read steps: - - uses: "ngrok/ngrok-operator/.github/actions/build-and-test.yaml@${{ github.sha }}" + - uses: ".github/actions/build-and-test.yaml" with: run-e2e: true go-version: ${{ env.GO_VERSION }} From be2e25ac8b94a47129f9ba842a101c18e4e7d8bd Mon Sep 17 00:00:00 2001 From: Harrison Katz Date: Mon, 25 Nov 2024 10:58:02 -0500 Subject: [PATCH 25/38] With checkout prior --- .github/actions/build-and-test.yaml | 1 - .github/actions/changes.yaml | 1 - .github/workflows/ci.yaml | 2 ++ .github/workflows/test.yaml | 2 ++ 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/actions/build-and-test.yaml b/.github/actions/build-and-test.yaml index 89ae91d2..c83dccc5 100644 --- a/.github/actions/build-and-test.yaml +++ b/.github/actions/build-and-test.yaml @@ -14,7 +14,6 @@ inputs: runs: using: "composite" steps: - - uses: actions/checkout@v3 - uses: debianmaster/actions-k3s@master id: k3s with: diff --git a/.github/actions/changes.yaml b/.github/actions/changes.yaml index bbf51a8b..6086c2db 100644 --- a/.github/actions/changes.yaml +++ b/.github/actions/changes.yaml @@ -12,7 +12,6 @@ outputs: runs: using: "composite" steps: - - uses: actions/checkout@v3 - id: filter uses: dorny/paths-filter@v2.11.1 with: diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6b507d73..b66f6ce0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -19,6 +19,7 @@ jobs: contents: read pull-requests: read steps: + - uses: actions/checkout@v3 - uses: ".github/actions/changes.yaml" # Make sure that Kubebuilder autogenerated files are up to date. @@ -95,6 +96,7 @@ jobs: contents: read pull-requests: read steps: + - uses: actions/checkout@v3 - uses: ".github/actions/build-and-test.yaml" with: # this workflow is for incoming PRs, so we want to skip e2e tests diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 07f00f86..cc67a385 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -16,6 +16,7 @@ jobs: contents: read pull-requests: read steps: + - uses: actions/checkout@v3 - uses: ".github/actions/changes.yaml" build-and-test: @@ -33,6 +34,7 @@ jobs: contents: read pull-requests: read steps: + - uses: actions/checkout@v3 - uses: ".github/actions/build-and-test.yaml" with: run-e2e: true From 5881ef6aa0e407e215f94439aae598a216be0e5f Mon Sep 17 00:00:00 2001 From: Harrison Katz Date: Mon, 25 Nov 2024 10:59:20 -0500 Subject: [PATCH 26/38] With local path --- .github/workflows/ci.yaml | 4 ++-- .github/workflows/test.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b66f6ce0..c9bf5ecf 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,7 +20,7 @@ jobs: pull-requests: read steps: - uses: actions/checkout@v3 - - uses: ".github/actions/changes.yaml" + - uses: "./.github/actions/changes" # Make sure that Kubebuilder autogenerated files are up to date. kubebuilder-diff: @@ -97,7 +97,7 @@ jobs: pull-requests: read steps: - uses: actions/checkout@v3 - - uses: ".github/actions/build-and-test.yaml" + - uses: "./.github/actions/build-and-test" with: # this workflow is for incoming PRs, so we want to skip e2e tests # and deploy the demo mode because our api keys are not available diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index cc67a385..27363a6b 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -17,7 +17,7 @@ jobs: pull-requests: read steps: - uses: actions/checkout@v3 - - uses: ".github/actions/changes.yaml" + - uses: "./.github/actions/changes" build-and-test: runs-on: ubuntu-latest @@ -35,7 +35,7 @@ jobs: pull-requests: read steps: - uses: actions/checkout@v3 - - uses: ".github/actions/build-and-test.yaml" + - uses: "./.github/actions/build-and-test" with: run-e2e: true go-version: ${{ env.GO_VERSION }} From 92940b71196c814920b8f14009e5863e0dd2f232 Mon Sep 17 00:00:00 2001 From: Harrison Katz Date: Mon, 25 Nov 2024 11:02:05 -0500 Subject: [PATCH 27/38] With .yaml --- .github/workflows/ci.yaml | 4 ++-- .github/workflows/test.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c9bf5ecf..8f771a6e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,7 +20,7 @@ jobs: pull-requests: read steps: - uses: actions/checkout@v3 - - uses: "./.github/actions/changes" + - uses: "./.github/actions/changes.yaml" # Make sure that Kubebuilder autogenerated files are up to date. kubebuilder-diff: @@ -97,7 +97,7 @@ jobs: pull-requests: read steps: - uses: actions/checkout@v3 - - uses: "./.github/actions/build-and-test" + - uses: "./.github/actions/build-and-test.yaml" with: # this workflow is for incoming PRs, so we want to skip e2e tests # and deploy the demo mode because our api keys are not available diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 27363a6b..d6acdc14 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -17,7 +17,7 @@ jobs: pull-requests: read steps: - uses: actions/checkout@v3 - - uses: "./.github/actions/changes" + - uses: "./.github/actions/changes.yaml" build-and-test: runs-on: ubuntu-latest @@ -35,7 +35,7 @@ jobs: pull-requests: read steps: - uses: actions/checkout@v3 - - uses: "./.github/actions/build-and-test" + - uses: "./.github/actions/build-and-test.yaml" with: run-e2e: true go-version: ${{ env.GO_VERSION }} From a8d0e2998f7be324f5845c221df668a74629d96c Mon Sep 17 00:00:00 2001 From: Harrison Katz Date: Tue, 26 Nov 2024 09:49:55 -0500 Subject: [PATCH 28/38] With directories --- .../{build-and-test.yaml => build-and-test/action.yaml} | 0 .github/actions/{changes.yaml => changes/action.yaml} | 0 .github/workflows/ci.yaml | 4 ++-- .github/workflows/test.yaml | 4 ++-- 4 files changed, 4 insertions(+), 4 deletions(-) rename .github/actions/{build-and-test.yaml => build-and-test/action.yaml} (100%) rename .github/actions/{changes.yaml => changes/action.yaml} (100%) diff --git a/.github/actions/build-and-test.yaml b/.github/actions/build-and-test/action.yaml similarity index 100% rename from .github/actions/build-and-test.yaml rename to .github/actions/build-and-test/action.yaml diff --git a/.github/actions/changes.yaml b/.github/actions/changes/action.yaml similarity index 100% rename from .github/actions/changes.yaml rename to .github/actions/changes/action.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8f771a6e..c9bf5ecf 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,7 +20,7 @@ jobs: pull-requests: read steps: - uses: actions/checkout@v3 - - uses: "./.github/actions/changes.yaml" + - uses: "./.github/actions/changes" # Make sure that Kubebuilder autogenerated files are up to date. kubebuilder-diff: @@ -97,7 +97,7 @@ jobs: pull-requests: read steps: - uses: actions/checkout@v3 - - uses: "./.github/actions/build-and-test.yaml" + - uses: "./.github/actions/build-and-test" with: # this workflow is for incoming PRs, so we want to skip e2e tests # and deploy the demo mode because our api keys are not available diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index d6acdc14..27363a6b 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -17,7 +17,7 @@ jobs: pull-requests: read steps: - uses: actions/checkout@v3 - - uses: "./.github/actions/changes.yaml" + - uses: "./.github/actions/changes" build-and-test: runs-on: ubuntu-latest @@ -35,7 +35,7 @@ jobs: pull-requests: read steps: - uses: actions/checkout@v3 - - uses: "./.github/actions/build-and-test.yaml" + - uses: "./.github/actions/build-and-test" with: run-e2e: true go-version: ${{ env.GO_VERSION }} From 69b13ca5f7e188d7f908911b7c708aeb7deb50f7 Mon Sep 17 00:00:00 2001 From: Harrison Katz Date: Tue, 26 Nov 2024 09:57:26 -0500 Subject: [PATCH 29/38] With correct outputs syntax --- .github/actions/changes/action.yaml | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/.github/actions/changes/action.yaml b/.github/actions/changes/action.yaml index 6086c2db..f444b6aa 100644 --- a/.github/actions/changes/action.yaml +++ b/.github/actions/changes/action.yaml @@ -2,17 +2,30 @@ name: Action - Changes description: "Detect changes in the repository" outputs: - charts: ${{ steps.filter.outputs.charts }} - chartyaml: ${{ steps.filter.outputs.chartyaml }} - go: ${{ steps.filter.outputs.go }} - tag: ${{ steps.filter.outputs.tag }} - tests: ${{ steps.filter.outputs.tests }} - make: ${{ steps.filter.outputs.make }} + charts: + description: "If any part of Helm charts have changed" + value: ${{ steps.filter.outputs.charts }} + chartyaml: + description: "If the Helm Chart.yaml has changed" + value: ${{ steps.filter.outputs.chartyaml }} + go: + description: "If the go (build) files have changed" + value: ${{ steps.filter.outputs.go }} + tag: + description: "If the tag (VERSION) has changed" + value: ${{ steps.filter.outputs.tag }} + tests: + description: "If the tests have changed" + value: ${{ steps.filter.outputs.tests }} + make: + description: "If the Makefile has changed" + value: ${{ steps.filter.outputs.make }} runs: using: "composite" steps: - - id: filter + - name: filter + id: filter uses: dorny/paths-filter@v2.11.1 with: filters: | From 080193a2ac79535efc8c25094a68df1a848f7f56 Mon Sep 17 00:00:00 2001 From: Harrison Katz Date: Tue, 26 Nov 2024 10:09:02 -0500 Subject: [PATCH 30/38] With changes id --- .github/workflows/ci.yaml | 1 + .github/workflows/test.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c9bf5ecf..312e4358 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -21,6 +21,7 @@ jobs: steps: - uses: actions/checkout@v3 - uses: "./.github/actions/changes" + id: changes # Make sure that Kubebuilder autogenerated files are up to date. kubebuilder-diff: diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 27363a6b..dd2b6c13 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -18,6 +18,7 @@ jobs: steps: - uses: actions/checkout@v3 - uses: "./.github/actions/changes" + id: changes build-and-test: runs-on: ubuntu-latest From 2d57f105c1cb488bf78c21abbcdd408ff37ffd0d Mon Sep 17 00:00:00 2001 From: Harrison Katz Date: Tue, 26 Nov 2024 10:11:40 -0500 Subject: [PATCH 31/38] Test with no if conditional --- .github/workflows/ci.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 312e4358..35dad377 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -87,12 +87,12 @@ jobs: needs: - changes - kubebuilder-diff - if: | - (needs.changes.outputs.go == 'true') || - (needs.changes.outputs.charts == 'true') || - (needs.changes.outputs.chartyaml == 'true') || - (needs.changes.outputs.tests == 'true') || - (needs.changes.outputs.make == 'true') + # if: | + # (needs.changes.outputs.go == 'true') || + # (needs.changes.outputs.charts == 'true') || + # (needs.changes.outputs.chartyaml == 'true') || + # (needs.changes.outputs.tests == 'true') || + # (needs.changes.outputs.make == 'true') permissions: contents: read pull-requests: read From eae599ed514714c3841dca07224fa9e0b8cf5c83 Mon Sep 17 00:00:00 2001 From: Harrison Katz Date: Tue, 26 Nov 2024 10:16:35 -0500 Subject: [PATCH 32/38] Without env key --- .github/actions/build-and-test/action.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/actions/build-and-test/action.yaml b/.github/actions/build-and-test/action.yaml index c83dccc5..59d8032e 100644 --- a/.github/actions/build-and-test/action.yaml +++ b/.github/actions/build-and-test/action.yaml @@ -5,11 +5,10 @@ inputs: run-e2e: description: "Run e2e tests" required: false - default: false + default: "false" go-version: description: "Go version to use" - required: false - default: "${{ env.GO_VERSION }}" + required: true runs: using: "composite" From 0d7684ddf921bd95c3bf54c5c5fe315185813f50 Mon Sep 17 00:00:00 2001 From: Harrison Katz Date: Tue, 26 Nov 2024 10:19:53 -0500 Subject: [PATCH 33/38] With required shell field --- .github/actions/build-and-test/action.yaml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/actions/build-and-test/action.yaml b/.github/actions/build-and-test/action.yaml index 59d8032e..0aacf0e6 100644 --- a/.github/actions/build-and-test/action.yaml +++ b/.github/actions/build-and-test/action.yaml @@ -17,7 +17,9 @@ runs: id: k3s with: version: 'latest' - - run: | + + - shell: bash + run: | kubectl get nodes kubectl get pods -A @@ -27,21 +29,27 @@ runs: go-version: ${{ inputs.go-version }} - name: Build + shell: bash run: make build - name: Lint + shell: bash run: make lint - name: Setup Envtest + shell: bash run: make envtest - name: Test + shell: bash run: make test - name: Build the Docker image + shell: bash run: make docker-build - name: Deploy controller to local cluster + shell: bash env: # deploy with 1-click demo mode when not running e2e tests DEPLOY_ONE_CLICK_DEMO_MODE: ${{ inputs.run-e2e && 'false' || 'true' }} @@ -56,6 +64,7 @@ runs: make deploy_for_e2e - name: Check if controller is up + shell: bash run: | kubectl get nodes kubectl get pods -A @@ -70,6 +79,7 @@ runs: verify: true - name: Run e2e tests + shell: bash if: inputs.run-e2e run: | make e2e-tests @@ -78,6 +88,7 @@ runs: # this allows our finalizers to delete upstream ngrok API resources too # that hopefully helps not pollute our ngrok-operator-ci account - name: Cleanup e2e tests + shell: bash if: inputs.run-e2e run: | make e2e-clean From b2cca682d46a1211a3845d220a5a5c0267c05134 Mon Sep 17 00:00:00 2001 From: Harrison Katz Date: Tue, 26 Nov 2024 10:23:45 -0500 Subject: [PATCH 34/38] With secrets as inputs --- .github/actions/build-and-test/action.yaml | 12 ++++++++++-- .github/workflows/test.yaml | 2 ++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/actions/build-and-test/action.yaml b/.github/actions/build-and-test/action.yaml index 0aacf0e6..dc4389ae 100644 --- a/.github/actions/build-and-test/action.yaml +++ b/.github/actions/build-and-test/action.yaml @@ -9,6 +9,14 @@ inputs: go-version: description: "Go version to use" required: true + ngrok-api-key: + description: "NGROK_API_KEY for e2e tests, if enabled" + required: false + default: "fake-api-key" + ngrok-authtoken: + description: "NGROK_AUTHTOKEN for e2e tests, if enabled" + required: false + default: "fake-authtoken" runs: using: "composite" @@ -53,8 +61,8 @@ runs: env: # deploy with 1-click demo mode when not running e2e tests DEPLOY_ONE_CLICK_DEMO_MODE: ${{ inputs.run-e2e && 'false' || 'true' }} - NGROK_API_KEY: ${{ github.repository == 'ngrok/ngrok-operator' && secrets.NGROK_CI_API_KEY || 'fake-api-key' }} - NGROK_AUTHTOKEN: ${{ github.repository == 'ngrok/ngrok-operator' && secrets.NGROK_CI_AUTHTOKEN || 'fake-authtoken' }} + NGROK_API_KEY: ${{ inputs.ngrok-api-key }} + NGROK_AUTHTOKEN: ${{ inputs.ngrok-authtoken }} E2E_BINDING_NAME: k8s/e2e-${{ github.run_id }} run: | # create some namespaces for bindings tests diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index dd2b6c13..5c9f1ea3 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -40,3 +40,5 @@ jobs: with: run-e2e: true go-version: ${{ env.GO_VERSION }} + ngrok-api-key: ${{ secrets.NGROK_CI_API_KEY }} + ngrok-authtoken: ${{ secrets.NGROK_CI_AUTHTOKEN }} From 9bb6a631d930d95b08e9b10d8e9e651a010b6a18 Mon Sep 17 00:00:00 2001 From: Harrison Katz Date: Tue, 26 Nov 2024 10:34:24 -0500 Subject: [PATCH 35/38] With proper if statements --- .github/actions/build-and-test/action.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/actions/build-and-test/action.yaml b/.github/actions/build-and-test/action.yaml index dc4389ae..58008498 100644 --- a/.github/actions/build-and-test/action.yaml +++ b/.github/actions/build-and-test/action.yaml @@ -60,7 +60,7 @@ runs: shell: bash env: # deploy with 1-click demo mode when not running e2e tests - DEPLOY_ONE_CLICK_DEMO_MODE: ${{ inputs.run-e2e && 'false' || 'true' }} + DEPLOY_ONE_CLICK_DEMO_MODE: ${{ inputs.run-e2e == 'true' && 'false' || 'true' }} NGROK_API_KEY: ${{ inputs.ngrok-api-key }} NGROK_AUTHTOKEN: ${{ inputs.ngrok-authtoken }} E2E_BINDING_NAME: k8s/e2e-${{ github.run_id }} @@ -78,17 +78,17 @@ runs: kubectl get pods -A - name: Install cosign - if: inputs.run-e2e + if: ${{ inputs.run-e2e == 'true' }} uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da # v3.7.0 - name: Install chainsaw - if: inputs.run-e2e + if: ${{ inputs.run-e2e == 'true' }} uses: kyverno/action-install-chainsaw@d311eacde764f806c9658574ff64c9c3b21f8397 # v0.2.11 with: verify: true - name: Run e2e tests shell: bash - if: inputs.run-e2e + if: ${{ inputs.run-e2e == 'true' }} run: | make e2e-tests @@ -97,6 +97,6 @@ runs: # that hopefully helps not pollute our ngrok-operator-ci account - name: Cleanup e2e tests shell: bash - if: inputs.run-e2e + if: ${{ inputs.run-e2e == 'true' }} run: | make e2e-clean From 226725cfa0dd40f91ec73c85ed341724b642b981 Mon Sep 17 00:00:00 2001 From: Harrison Katz Date: Tue, 26 Nov 2024 10:26:42 -0500 Subject: [PATCH 36/38] With if conditional back --- .github/workflows/ci.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 35dad377..312e4358 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -87,12 +87,12 @@ jobs: needs: - changes - kubebuilder-diff - # if: | - # (needs.changes.outputs.go == 'true') || - # (needs.changes.outputs.charts == 'true') || - # (needs.changes.outputs.chartyaml == 'true') || - # (needs.changes.outputs.tests == 'true') || - # (needs.changes.outputs.make == 'true') + if: | + (needs.changes.outputs.go == 'true') || + (needs.changes.outputs.charts == 'true') || + (needs.changes.outputs.chartyaml == 'true') || + (needs.changes.outputs.tests == 'true') || + (needs.changes.outputs.make == 'true') permissions: contents: read pull-requests: read From 5ce981a28036087f4b19d24999840dd9076de5a9 Mon Sep 17 00:00:00 2001 From: Harrison Katz Date: Tue, 26 Nov 2024 10:58:02 -0500 Subject: [PATCH 37/38] Test with echo --- .github/workflows/ci.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 312e4358..56b10d61 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -82,6 +82,18 @@ jobs: - run: git diff --exit-code go.mod - run: git diff --exit-code go.sum + echo: + runs-on: ubuntu-latest + needs: [changes] + steps: + - uses: actions/checkout@v3 + - run: | + echo "go: ${{ needs.changes.outputs.go }}" + echo "charts: ${{ needs.changes.outputs.charts }}" + echo "chartyaml: ${{ needs.changes.outputs.chartyaml }}" + echo "tests: ${{ needs.changes.outputs.tests }}" + echo "make: ${{ needs.changes.outputs.make }}" + build-and-test: runs-on: ubuntu-latest needs: From 0be00244777ea4393cdd43985b5290c0e123e6d7 Mon Sep 17 00:00:00 2001 From: Harrison Katz Date: Tue, 26 Nov 2024 12:40:54 -0500 Subject: [PATCH 38/38] With outputs on job too --- .github/workflows/ci.yaml | 7 +++++++ .github/workflows/test.yaml | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 56b10d61..c55dcc47 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -18,6 +18,13 @@ jobs: permissions: contents: read pull-requests: read + outputs: + charts: ${{ steps.changes.outputs.charts }} + chartyaml: ${{ steps.changes.outputs.chartyaml }} + go: ${{ steps.changes.outputs.go }} + tag: ${{ steps.changes.outputs.tag }} + tests: ${{ steps.changes.outputs.tests }} + make: ${{ steps.changes.outputs.make }} steps: - uses: actions/checkout@v3 - uses: "./.github/actions/changes" diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 5c9f1ea3..477eed5e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -15,6 +15,13 @@ jobs: permissions: contents: read pull-requests: read + outputs: + charts: ${{ steps.changes.outputs.charts }} + chartyaml: ${{ steps.changes.outputs.chartyaml }} + go: ${{ steps.changes.outputs.go }} + tag: ${{ steps.changes.outputs.tag }} + tests: ${{ steps.changes.outputs.tests }} + make: ${{ steps.changes.outputs.make }} steps: - uses: actions/checkout@v3 - uses: "./.github/actions/changes"