Skip to content

Commit

Permalink
Test using kind cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
jonstacks committed Dec 19, 2024
1 parent 97c88f2 commit ff6a1c4
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 19 deletions.
11 changes: 6 additions & 5 deletions .github/actions/build-and-test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
with:
version: 'latest'
version: ${{ inputs.kind-version }}

- shell: bash
run: |
Expand Down Expand Up @@ -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
Expand Down
28 changes: 14 additions & 14 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: CI
on:
push:
branches: [ "main" ]
# branches: [ "main" ]
pull_request:
branches: [ "main" ]
merge_group:
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down

0 comments on commit ff6a1c4

Please sign in to comment.