Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/invoke-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
ref: master
- run: npm i octokit @octokit/core
- name: Trigger push workflow
uses: actions/github-script@v6
uses: actions/github-script@v7
env:
APP_ID: ${{ secrets.APP_ID }}
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Lint and Test Charts

on: [pull_request,push]

jobs:
lint-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Helm
uses: azure/setup-helm@v4

- uses: actions/setup-python@v5
with:
python-version: '3.9'
check-latest: true

- name: Set up chart-testing
uses: helm/chart-testing-action@v2.6.1

- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed_files=$(ct list-changed --config ct.yaml --target-branch ${{ github.event.repository.default_branch }} 2>/dev/null | wc -l | tr -d ' ')
echo "Changed files detected: $changed_files"
if [ $changed_files -ne 0 ]; then
echo "changed=true" >> $GITHUB_OUTPUT
else
echo "changed=false" >> $GITHUB_OUTPUT
fi

- name: Run chart-testing (lint)
if: steps.list-changed.outputs.changed == 'true'
run: ct lint --config ct.yaml --target-branch ${{ github.event.repository.default_branch }} --validate-maintainers=false

- name: Create kind cluster
if: steps.list-changed.outputs.changed == 'true'
uses: helm/kind-action@v1.10.0

- name: Run chart-testing (install)
if: steps.list-changed.outputs.changed == 'true'
run: ct install --config ct.yaml --target-branch ${{ github.event.repository.default_branch }}
6 changes: 3 additions & 3 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
path: self

- name: Validate chart
uses: actions/github-script@v6
uses: actions/github-script@v7
env:
APP_ID: ${{ secrets.APP_ID }}
APP_PRIVATE_KEY: ${{ secrets.GH_APP_PEM }}
Expand All @@ -62,7 +62,7 @@ jobs:
path: source

- name: Package charts
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
script: |
const helm = require('./self/.github/workflows/scripts/packageChart.js')
Expand All @@ -72,7 +72,7 @@ jobs:
run: npm i octokit fs @octokit/core

- name: Update index and push files
uses: actions/github-script@v6
uses: actions/github-script@v7
env:
APP_ID: ${{ secrets.APP_ID }}
APP_PRIVATE_KEY: ${{ secrets.GH_APP_PEM }}
Expand Down
2 changes: 2 additions & 0 deletions ct.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
chart-dirs:
- ./