-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Lan Liang <gcslyp@gmail.com>
- Loading branch information
1 parent
5758fa2
commit 42c5182
Showing
3 changed files
with
83 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# validate any chart changes under charts directory | ||
name: Chart Lint | ||
|
||
env: | ||
HELM_VERSION: v3.11.2 | ||
KIND_VERSION: v0.23.0 | ||
KIND_NODE_IMAGE: kindest/node:v1.30.0 | ||
K8S_VERSION: v1.30.0 | ||
|
||
on: | ||
push: | ||
# Exclude branches created by Dependabot to avoid triggering current workflow | ||
# for PRs initiated by Dependabot. | ||
branches-ignore: | ||
- 'dependabot/**' | ||
paths: | ||
- "kwok/charts/**" | ||
pull_request: | ||
paths: | ||
- "kwok/charts/**" | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
chart-lint-test: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Helm | ||
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0 | ||
with: | ||
version: ${{ env.HELM_VERSION }} | ||
|
||
- name: Run chart-testing (template) | ||
run: | | ||
helm template --dependency-update ./kwok/charts --debug > /dev/null | ||
# Python is required because `ct lint` runs Yamale (https://github.com/23andMe/Yamale) and | ||
# yamllint (https://github.com/adrienverge/yamllint) which require Python | ||
- name: Set up Python | ||
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1 | ||
with: | ||
python-version: 3.10 | ||
check-latest: true | ||
|
||
- name: Set up chart-testing | ||
uses: helm/chart-testing-action@e6669bcd63d7cb57cb4380c33043eebe5d111992 | ||
|
||
- name: Add dependency chart repos | ||
run: | | ||
helm repo add bitnami https://charts.bitnami.com/bitnami | ||
- name: Run chart-testing (list-changed) | ||
id: list-changed | ||
run: | | ||
Check failure on line 60 in .github/workflows/lint-chart.yaml GitHub Actions / presubmit (1.25.x)
Check failure on line 60 in .github/workflows/lint-chart.yaml GitHub Actions / presubmit (1.26.x)
Check failure on line 60 in .github/workflows/lint-chart.yaml GitHub Actions / presubmit (1.27.x)
Check failure on line 60 in .github/workflows/lint-chart.yaml GitHub Actions / presubmit (1.28.x)
Check failure on line 60 in .github/workflows/lint-chart.yaml GitHub Actions / presubmit (1.29.x)
|
||
changed=$( ct list-changed ) | ||
if [[ -n "$changed" ]]; then | ||
echo "changed=true" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Run chart-testing (lint) | ||
if: steps.list-changed.outputs.changed == 'true' | ||
run: ct lint --debug --check-version-increment=false | ||
|
||
- name: Create kind cluster | ||
uses: helm/kind-action@0025e74a8c7512023d06dc019c617aa3cf561fde # v1.10.0 | ||
if: steps.list-changed.outputs.changed == 'true' | ||
with: | ||
wait: 120s | ||
version: ${{ env.KIND_VERSION }} | ||
node_image: ${{ env.KIND_NODE_IMAGE }} | ||
kubectl_version: ${{ env.K8S_VERSION }} | ||
|
||
- name: Run chart-testing (install) | ||
if: steps.list-changed.outputs.changed == 'true' | ||
run: ct install --debug --helm-extra-args "--timeout 800s" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,4 +75,4 @@ rules: | |
# Write | ||
- apiGroups: ["coordination.k8s.io"] | ||
resources: ["leases"] | ||
verbs: ["delete"] | ||
verbs: ["delete"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters