Archived
1
0

refactor: add helm script and job

This commit is contained in:
Joe Previte 2022-09-16 22:17:32 -07:00
parent f36c1f5b91
commit 3028e8ebf8
No known key found for this signature in database
GPG Key ID: 2C91590C6B742C24
4 changed files with 43 additions and 3 deletions

View File

@ -108,6 +108,34 @@ jobs:
if: failure()
uses: andymckay/cancel-action@0.2
lint-helm:
name: Lint Helm chart
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v23.2
with:
files: |
ci/helm-chart/**
- name: Install helm
uses: azure/setup-helm@v3.3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Lint Helm chart
if: steps.changed-files.outputs.any_changed == 'true'
run: ./ci/dev/helm.sh
- name: Fail workflow
if: failure()
uses: andymckay/cancel-action@0.2
build:
name: Build
needs: prebuild

14
ci/dev/helm.sh Executable file
View File

@ -0,0 +1,14 @@
#!/usr/bin/env bash
set -euo pipefail
main() {
cd "$(dirname "$0")/../.."
if command -v helm && helm kubeval --help > /dev/null; then
helm kubeval ci/helm-chart
fi
cd "$OLDPWD"
}
main "$@"

View File

@ -6,9 +6,6 @@ main() {
eslint --max-warnings=0 --fix $(git ls-files "*.ts" "*.tsx" "*.js" | grep -v "lib/vscode")
tsc --noEmit --skipLibCheck
if command -v helm && helm kubeval --help > /dev/null; then
helm kubeval ci/helm-chart
fi
cd "$OLDPWD"
}

View File

@ -27,6 +27,7 @@
"_audit": "./ci/dev/audit.sh",
"fmt": "./ci/dev/fmt.sh",
"lint": "./ci/dev/lint.sh",
"lint:helm": "./ci/dedv/helm.sh",
"lint:sh": "shellcheck -e SC2046,SC2164,SC2154,SC1091,SC1090,SC2002 $(git ls-files '*.sh' | grep -v 'lib/vscode')",
"test": "echo 'Run yarn test:unit or yarn test:e2e' && exit 1",
"ci": "./ci/dev/ci.sh",