From c95eeeffb86331c745d0309d17c54e5ff3459eb8 Mon Sep 17 00:00:00 2001 From: "A. F. Dudley" Date: Thu, 2 Apr 2026 04:30:37 +0000 Subject: [PATCH] add k8s deploy e2e test to CI and pre-push hook - .github/workflows/test-k8s-deploy.yml: new workflow that installs kind+kubectl and runs tests/k8s-deploy/run-deploy-test.sh on every push and PR. Same script used locally and in release validation. - .pre-commit-config.yaml: add local pre-push hook that runs the k8s e2e test (~3 min) before pushing to remote. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/test-k8s-deploy.yml | 39 +++++++++++++++++++++++++++ .pre-commit-config.yaml | 11 ++++++++ 2 files changed, 50 insertions(+) create mode 100644 .github/workflows/test-k8s-deploy.yml diff --git a/.github/workflows/test-k8s-deploy.yml b/.github/workflows/test-k8s-deploy.yml new file mode 100644 index 00000000..6bc40ed2 --- /dev/null +++ b/.github/workflows/test-k8s-deploy.yml @@ -0,0 +1,39 @@ +name: K8s Deploy Test + +on: + pull_request: + branches: '*' + push: + branches: '*' + +jobs: + test: + name: "Run k8s deploy e2e test suite" + runs-on: ubuntu-latest + steps: + - name: "Clone project repository" + uses: actions/checkout@v3 + - name: "Install Python" + uses: actions/setup-python@v4 + with: + python-version: '3.8' + - name: "Install kind" + run: | + [ -f /usr/local/bin/kind ] && exit 0 + curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.27.0/kind-linux-amd64 + chmod +x ./kind + sudo mv ./kind /usr/local/bin/kind + - name: "Install kubectl" + run: | + [ -f /usr/local/bin/kubectl ] && exit 0 + curl -Lo ./kubectl "https://dl.k8s.io/release/$(curl -sL https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" + chmod +x ./kubectl + sudo mv ./kubectl /usr/local/bin/kubectl + - name: "Install shiv" + run: pip install shiv + - name: "Generate build version file" + run: ./scripts/create_build_tag_file.sh + - name: "Build local shiv package" + run: ./scripts/build_shiv_package.sh + - name: "Run k8s deploy e2e tests" + run: ./tests/k8s-deploy/run-deploy-test.sh diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b01ad2be..b97571bb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -32,3 +32,14 @@ repos: hooks: - id: yamllint args: [-d, relaxed] + + # Pre-push: run the full k8s e2e test suite (~3 min). + # Same script used by CI and release validation. + - repo: local + hooks: + - id: k8s-deploy-test + name: k8s deploy e2e test + entry: tests/k8s-deploy/run-deploy-test.sh + language: system + stages: [pre-push] + pass_filenames: false