-
Notifications
You must be signed in to change notification settings - Fork 80
79 lines (65 loc) · 2.07 KB
/
helm-test.yaml
File metadata and controls
79 lines (65 loc) · 2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Test Helm Chart
on:
pull_request:
paths:
- "!*.md"
- "deploy/charts/version-checker/**"
branches:
- "main"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
pull-requests: read
checks: write
jobs:
lint:
name: Lint Helm Chart
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
- name: Setup Golang
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- uses: azure/setup-helm@v5
with:
version: v3.19.0
- run: helm lint deploy/charts/version-checker
test:
name: Run unit tests for Helm Chart
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
- name: Setup Golang
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- uses: azure/setup-helm@v5
with:
version: v3.19.0
- name: Install helm Plugins
run: |
if [ ! -e "${HELM_PLUGINS}/helm-unittest" ]; then
helm plugin install https://github.com/helm-unittest/helm-unittest.git
fi
- name: Run Tests
run: |
if [ ! -e "deploy/charts/version-checker/tests" ]; then
echo "Not running tests, directory doesn't exist: deploy/charts/version-checker/tests"
exit 0
fi
helm unittest deploy/charts/version-checker
security_policies:
name: Verify that the Helm chart complies with the pod security standards
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
- name: Install Kyverno CLI
uses: kyverno/action-install-cli@v0.2.0
- run: |-
kyverno apply -p https://github.com/kyverno/policies/pod-security/restricted --git-branch main --resource <(helm template deploy/charts/version-checker/)