88 branches :
99 - main
1010
11+ concurrency :
12+ group : ${{ github.workflow }}-${{ github.event.pull_request.number }}
13+ cancel-in-progress : true
14+
1115jobs :
1216 lint-test :
1317 runs-on : ubuntu-latest
18+ timeout-minutes : 30
19+ permissions :
20+ contents : read
1421 outputs :
1522 changed : ${{ steps.list-changed.outputs.changed }}
1623 changedCharts : ${{ steps.list-changed.outputs.changedCharts }}
1724 steps :
1825 - name : Setup Helm
19- uses : Azure/setup-helm@v4.3.1
26+ uses : Azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4.3.1
2027
2128 - name : Checkout pull request branch
22- uses : actions/checkout@v5.0.0
29+ uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2330 with :
2431 ref : ${{ github.head_ref }}
2532 repository : ${{github.event.pull_request.head.repo.full_name}}
@@ -28,12 +35,13 @@ jobs:
2835 # Python is required because `ct lint` runs Yamale (https://github.com/23andMe/Yamale) and
2936 # yamllint (https://github.com/adrienverge/yamllint) which require Python
3037 - name : Set up Python
31- uses : actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1
38+ uses : actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
3239 with :
3340 python-version : 3.x
41+ cache : ' pip'
3442
3543 - name : Set up chart-testing-action
36- uses : helm/chart-testing-action@v2.7.0
44+ uses : helm/chart-testing-action@0d28d3144d3a25ea2cc349d6e59901c4ff469b3b # v2.7.0
3745
3846 - name : Get changed charts
3947 id : list-changed
@@ -50,40 +58,70 @@ jobs:
5058 echo "No chart changes detected"
5159 fi
5260
61+ - name : Cache Helm plugins
62+ if : steps.list-changed.outputs.changed == 'true'
63+ uses : actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
64+ with :
65+ path : ~/.local/share/helm/plugins
66+ key : ${{ runner.os }}-helm-plugins-${{ hashFiles('**/plugin.yaml') }}
67+ restore-keys : |
68+ ${{ runner.os }}-helm-plugins-
69+
5370 - name : Installing plugin helm-unittest
5471 if : steps.list-changed.outputs.changed == 'true'
55- run : helm plugin install https://github.com/helm-unittest/helm-unittest >/dev/null
72+ run : |
73+ if ! helm plugin list | grep -q unittest; then
74+ helm plugin install https://github.com/helm-unittest/helm-unittest
75+ else
76+ echo "helm-unittest plugin already installed"
77+ fi
5678
5779 - name : Run chart testing (lint & unittest)
5880 if : steps.list-changed.outputs.changed == 'true'
5981 run : ct lint --target-branch ${{ github.event.repository.default_branch }} --validate-maintainers=false --additional-commands "helm unittest {{ .Path }}"
6082
6183 integration-test :
6284 runs-on : ubuntu-latest
85+ timeout-minutes : 30
86+ permissions :
87+ contents : read
6388 needs : [lint-test]
6489 if : needs.lint-test.outputs.changed == 'true'
6590 steps :
6691 - name : Checkout pull request branch
67- uses : actions/checkout@v5.0.0
92+ uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
6893 with :
6994 ref : ${{ github.head_ref }}
7095 repository : ${{github.event.pull_request.head.repo.full_name}}
7196 fetch-depth : 0
7297
7398 - name : Setup Helm
74- uses : Azure/setup-helm@v4.3.1
99+ uses : Azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4.3.1
75100
76101 - name : Setup kubectl
77- uses : azure/setup-kubectl@v4
102+ uses : azure/setup-kubectl@776406bce94f63e41d621b960d78ee25c8b76ede # v4.0.1
78103
79104 - name : Create kind cluster
80- uses : helm/kind-action@v1.12.0
105+ uses : helm/kind-action@a1b0e391336a6ee6713a0583f8c6240d70863de3 # v1.12.0
81106 with :
82107 cluster_name : helm-chart-test
83108 wait : 300s
84109
110+ - name : Cache Helm plugins
111+ uses : actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
112+ with :
113+ path : ~/.local/share/helm/plugins
114+ key : ${{ runner.os }}-helm-plugins-${{ hashFiles('**/plugin.yaml') }}
115+ restore-keys : |
116+ ${{ runner.os }}-helm-plugins-
117+
85118 - name : Installing plugin helm-unittest
86- run : helm plugin install https://github.com/helm-unittest/helm-unittest
119+ run : |
120+ if ! helm plugin list | grep -q unittest; then
121+ helm plugin install https://github.com/helm-unittest/helm-unittest
122+ else
123+ echo "helm-unittest plugin already installed"
124+ fi
87125
88126 - name : Run integration tests
89127 env :
@@ -104,6 +142,7 @@ jobs:
104142
105143 update-changelog :
106144 runs-on : ubuntu-latest
145+ timeout-minutes : 15
107146 needs : [lint-test]
108147 name : Automatically update CHANGELOG
109148 permissions :
@@ -112,7 +151,7 @@ jobs:
112151 if : always() && needs.lint-test.outputs.changed == 'true'
113152 steps :
114153 - name : Checkout PR branch
115- uses : actions/checkout@v5.0.0
154+ uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
116155 with :
117156 repository : ${{ github.event.pull_request.head.repo.full_name }}
118157 ref : ${{ github.event.pull_request.head.ref }}
@@ -183,7 +222,7 @@ jobs:
183222 - name : Commit and push via GitHub API
184223 id : push-changes
185224 if : steps.check-changes.outputs.has_changes == 'true'
186- uses : actions/github-script@v7
225+ uses : actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0
187226 with :
188227 github-token : ${{ secrets.GITHUB_TOKEN }}
189228 script : |
0 commit comments