From ff6a1c4c2df7f9b7b138d87a04f2dbc8df304e2d Mon Sep 17 00:00:00 2001 From: Jonathan Stacks Date: Thu, 19 Dec 2024 16:41:06 -0600 Subject: [PATCH] Test using kind cluster --- .github/actions/build-and-test/action.yaml | 11 +++++---- .github/workflows/ci.yaml | 28 +++++++++++----------- Makefile | 2 ++ 3 files changed, 22 insertions(+), 19 deletions(-) diff --git a/.github/actions/build-and-test/action.yaml b/.github/actions/build-and-test/action.yaml index a3fce655..1f4c8dca 100644 --- a/.github/actions/build-and-test/action.yaml +++ b/.github/actions/build-and-test/action.yaml @@ -17,14 +17,17 @@ inputs: description: "NGROK_AUTHTOKEN for e2e tests, if enabled" required: false default: "fake-authtoken" + kind-version: + description: "KIND version to use" + required: false + default: "v0.26.0" runs: using: "composite" steps: - - uses: debianmaster/actions-k3s@master - id: k3s + - uses: engineerd/setup-kind@v0.6.2 with: - version: 'latest' + version: ${{ inputs.kind-version }} - shell: bash run: | @@ -64,8 +67,6 @@ runs: NGROK_API_KEY: ${{ inputs.ngrok-api-key }} NGROK_AUTHTOKEN: ${{ inputs.ngrok-authtoken }} E2E_BINDING_NAME: k8s/e2e-${{ github.run_id }} - # use the latest image built in this run - IMG: ngrok/ngrok-operator run: | # create some namespaces for bindings tests kubectl create ns e2e || true diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a934eab5..a5598f85 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,7 +1,7 @@ name: CI on: push: - branches: [ "main" ] + # branches: [ "main" ] pull_request: branches: [ "main" ] merge_group: @@ -144,19 +144,19 @@ jobs: timeout-minutes: 20 # Only run the e2e tests if on the main branch or in a merge queue and # files have changed that require e2e tests - if: | - (github.repository == 'ngrok/ngrok-operator') && - ( - (github.event_name == 'push' && github.ref_name == 'main') || - (github.event_name == 'merge_group') - ) && - ( - (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: | + # (github.repository == 'ngrok/ngrok-operator') && + # ( + # (github.event_name == 'push' && github.ref_name == 'main') || + # (github.event_name == 'merge_group') + # ) && + # ( + # (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') + # ) steps: - uses: actions/checkout@v3 - uses: "./.github/actions/build-and-test" diff --git a/Makefile b/Makefile index 6b10c9a9..148a9a07 100644 --- a/Makefile +++ b/Makefile @@ -197,12 +197,14 @@ deploy_with_bindings: _deploy-check-env-vars docker-build manifests kustomize _h .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. + kind load docker-image $(IMG) 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 image.pullPolicy="Never" \ --set podAnnotations."k8s\.ngrok\.com/test"="\{\"env\": \"e2e\"\}" \ --set credentials.apiKey=$(NGROK_API_KEY) \ --set credentials.authtoken=$(NGROK_AUTHTOKEN) \