Skip to content

Commit 3028e8e

Browse files
committed
refactor: add helm script and job
1 parent f36c1f5 commit 3028e8e

File tree

4 files changed

+43
-3
lines changed

4 files changed

+43
-3
lines changed

.github/workflows/build.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,34 @@ jobs:
108108
if: failure()
109109
uses: andymckay/cancel-action@0.2
110110

111+
lint-helm:
112+
name: Lint Helm chart
113+
runs-on: ubuntu-latest
114+
timeout-minutes: 5
115+
steps:
116+
- name: Checkout repo
117+
uses: actions/checkout@v3
118+
119+
- name: Get changed files
120+
id: changed-files
121+
uses: tj-actions/changed-files@v23.2
122+
with:
123+
files: |
124+
ci/helm-chart/**
125+
126+
- name: Install helm
127+
uses: azure/setup-helm@v3.3
128+
with:
129+
token: ${{ secrets.GITHUB_TOKEN }}
130+
131+
- name: Lint Helm chart
132+
if: steps.changed-files.outputs.any_changed == 'true'
133+
run: ./ci/dev/helm.sh
134+
135+
- name: Fail workflow
136+
if: failure()
137+
uses: andymckay/cancel-action@0.2
138+
111139
build:
112140
name: Build
113141
needs: prebuild

ci/dev/helm.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
main() {
5+
cd "$(dirname "$0")/../.."
6+
7+
if command -v helm && helm kubeval --help > /dev/null; then
8+
helm kubeval ci/helm-chart
9+
fi
10+
11+
cd "$OLDPWD"
12+
}
13+
14+
main "$@"

ci/dev/lint.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ main() {
66

77
eslint --max-warnings=0 --fix $(git ls-files "*.ts" "*.tsx" "*.js" | grep -v "lib/vscode")
88
tsc --noEmit --skipLibCheck
9-
if command -v helm && helm kubeval --help > /dev/null; then
10-
helm kubeval ci/helm-chart
11-
fi
129

1310
cd "$OLDPWD"
1411
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"_audit": "./ci/dev/audit.sh",
2828
"fmt": "./ci/dev/fmt.sh",
2929
"lint": "./ci/dev/lint.sh",
30+
"lint:helm": "./ci/dedv/helm.sh",
3031
"lint:sh": "shellcheck -e SC2046,SC2164,SC2154,SC1091,SC1090,SC2002 $(git ls-files '*.sh' | grep -v 'lib/vscode')",
3132
"test": "echo 'Run yarn test:unit or yarn test:e2e' && exit 1",
3233
"ci": "./ci/dev/ci.sh",

0 commit comments

Comments
 (0)