From f24560bbc7c7b3c5511b8de33a56d05bde5114ed Mon Sep 17 00:00:00 2001 From: chandankumar4 Date: Wed, 22 May 2024 11:37:47 +0530 Subject: [PATCH] Add github action to verify helm changes Signed-off-by: chandankumar4 --- .github/workflows/verify.yaml | 45 +++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/verify.yaml diff --git a/.github/workflows/verify.yaml b/.github/workflows/verify.yaml new file mode 100644 index 0000000..1454ad9 --- /dev/null +++ b/.github/workflows/verify.yaml @@ -0,0 +1,45 @@ +name: verify + +on: pull_request + +jobs: + lint-test: + runs-on: ubuntu-latest + steps: + - name: "Step 1: Checkout" + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: "Step 2: Set up Helm" + uses: azure/setup-helm@v4.2.0 + with: + version: v3.14.4 + + - uses: "Step 3: actions/setup-python@v5" + with: + python-version: '3.x' + check-latest: true + + - name: "Step 4: Set up chart-testing" + uses: helm/chart-testing-action@v2.6.1 + + - name: "Step 5: Run chart-testing (list-changed)" + id: list-changed + run: | + changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }}) + if [[ -n "$changed" ]]; then + echo "changed=true" >> "$GITHUB_OUTPUT" + fi + + - name: "Step 6: Run lint" + if: steps.list-changed.outputs.changed == 'true' + run: ct lint --target-branch ${{ github.event.repository.default_branch }} + + - name: "Step 7: Create kind cluster" + if: steps.list-changed.outputs.changed == 'true' + uses: helm/kind-action@v1.10.0 + + - name: "Step 7: Run chart install" + if: steps.list-changed.outputs.changed == 'true' + run: ct install --target-branch ${{ github.event.repository.default_branch }} \ No newline at end of file