From 8ffc88ba2853173cb1f4655216122e795a168c4e Mon Sep 17 00:00:00 2001 From: Sheen Capadngan Date: Thu, 5 Jun 2025 03:28:04 +0800 Subject: [PATCH] misc: add verification check for secret operator --- .../workflows/release-k8-operator-helm.yml | 70 ++++++++++++++----- .../run-helm-chart-tests-secret-operator.yml | 38 ++++++++++ ct.yaml | 12 ++++ 3 files changed, 101 insertions(+), 19 deletions(-) create mode 100644 .github/workflows/run-helm-chart-tests-secret-operator.yml create mode 100644 ct.yaml diff --git a/.github/workflows/release-k8-operator-helm.yml b/.github/workflows/release-k8-operator-helm.yml index f3731fb46..7a9d867dd 100644 --- a/.github/workflows/release-k8-operator-helm.yml +++ b/.github/workflows/release-k8-operator-helm.yml @@ -1,27 +1,59 @@ name: Release K8 Operator Helm Chart on: - workflow_dispatch: + workflow_dispatch: jobs: - release-helm: - name: Release Helm Chart - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 + test-helm: + name: Test Helm Chart + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 - - name: Install Helm - uses: azure/setup-helm@v3 - with: - version: v3.10.0 + - name: Set up Helm + uses: azure/setup-helm@v4.2.0 + with: + version: v3.17.0 - - name: Install python - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5.3.0 + with: + python-version: "3.x" + check-latest: true - - name: Install Cloudsmith CLI - run: pip install --upgrade cloudsmith-cli + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.7.0 - - name: Build and push helm package to CloudSmith - run: cd helm-charts && sh upload-k8s-operator-cloudsmith.sh - env: - CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} + - name: Run chart-testing (lint) + run: ct lint --config ct.yaml --charts helm-charts/secrets-operator + + - name: Create kind cluster + uses: helm/kind-action@v1.12.0 + + - name: Run chart-testing (install) + run: ct install --config ct.yaml --charts helm-charts/secrets-operator + + release-helm: + name: Release Helm Chart + needs: test-helm + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install Helm + uses: azure/setup-helm@v3 + with: + version: v3.10.0 + + - name: Install python + uses: actions/setup-python@v4 + + - name: Install Cloudsmith CLI + run: pip install --upgrade cloudsmith-cli + + - name: Build and push helm package to CloudSmith + run: cd helm-charts && sh upload-k8s-operator-cloudsmith.sh + env: + CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} diff --git a/.github/workflows/run-helm-chart-tests-secret-operator.yml b/.github/workflows/run-helm-chart-tests-secret-operator.yml new file mode 100644 index 000000000..15bb38956 --- /dev/null +++ b/.github/workflows/run-helm-chart-tests-secret-operator.yml @@ -0,0 +1,38 @@ +name: Run Helm Chart Tests for Secret Operator +on: + pull_request: + paths: + - "helm-charts/secrets-operator/**" + - ".github/workflows/run-helm-chart-tests-secret-operator.yml" + +jobs: + test-helm: + name: Test Helm Chart + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up Helm + uses: azure/setup-helm@v4.2.0 + with: + version: v3.17.0 + + - uses: actions/setup-python@v5.3.0 + with: + python-version: "3.x" + check-latest: true + + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.7.0 + + - name: Run chart-testing (lint) + run: ct lint --config ct.yaml --charts helm-charts/secrets-operator + + - name: Create kind cluster + uses: helm/kind-action@v1.12.0 + + - name: Run chart-testing (install) + run: ct install --config ct.yaml --charts helm-charts/secrets-operator diff --git a/ct.yaml b/ct.yaml new file mode 100644 index 000000000..4c834ae03 --- /dev/null +++ b/ct.yaml @@ -0,0 +1,12 @@ +# Chart testing configuration +chart-dirs: + - helm-charts + +# Test against these Kubernetes versions +kube-versions: + - v1.30.0 + - v1.31.0 + - v1.32.0 + - v1.33.0 + +validate-maintainers: false