Skip to content

Commit ab58956

Browse files
committed
CI: switch to matrix strategy for kube chart testing to enable parallelism.
Brings CI runtime down to 3 minutes instead of ~9. Also: Makes it easier to test new versions (just add new lists)
1 parent 1912039 commit ab58956

1 file changed

Lines changed: 22 additions & 26 deletions

File tree

.github/workflows/on-push-lint-charts.yml

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ env:
1515
KUBE_SCORE_VERSION: 1.12.0
1616
HELM_VERSION: v3.4.1
1717

18+
concurrency:
19+
group: ${{ github.head_ref }}
20+
cancel-in-progress: true
21+
1822
jobs:
1923
lint-test:
2024
runs-on: ubuntu-latest
@@ -40,6 +44,19 @@ jobs:
4044
KUBE_SCORE: /tmp/bin/kube-score
4145
run: .ci/scripts/kube-score.sh
4246

47+
chart-testing:
48+
runs-on: ubuntu-latest
49+
strategy:
50+
matrix:
51+
# Choose from https://hub.docker.com/r/kindest/node/tags
52+
KubeVersion: [1.18.15,1.19.11,1.20.2]
53+
54+
steps:
55+
- name: Checkout
56+
uses: actions/checkout@v2
57+
with:
58+
fetch-depth: 0
59+
4360
# python is a requirement for the chart-testing action below (supports yamllint among other tests)
4461
- uses: actions/setup-python@v2
4562
with:
@@ -59,33 +76,12 @@ jobs:
5976
- name: Run chart-testing (lint)
6077
run: ct lint --config .ci/ct-config.yaml
6178

62-
# Refer to https://github.com/kubernetes-sigs/kind/releases when updating the node_images
63-
- name: Create 1.20 kind cluster
64-
uses: helm/kind-action@v1.2.0
65-
with:
66-
node_image: kindest/node:v1.20.2@sha256:8f7ea6e7642c0da54f04a7ee10431549c0257315b3a634f6ef2fecaaedb19bab
67-
cluster_name: kubernetes-1.20
68-
if: steps.list-changed.outputs.changed == 'true'
69-
70-
- name: Run chart-testing (install) against 1.20
71-
run: ct install --config .ci/ct-config.yaml
72-
73-
- name: Create 1.19 kind cluster
74-
uses: helm/kind-action@v1.2.0
75-
with:
76-
node_image: kindest/node:v1.19.7@sha256:a70639454e97a4b733f9d9b67e12c01f6b0297449d5b9cbbef87473458e26dca
77-
cluster_name: kubernetes-1.19
78-
if: steps.list-changed.outputs.changed == 'true'
79-
80-
- name: Run chart-testing (install) against 1.19
81-
run: ct install --config .ci/ct-config.yaml
82-
83-
- name: Create 1.18 kind cluster
79+
- name: Create ${{matrix.KubeVersion}} kind cluster
8480
uses: helm/kind-action@v1.2.0
8581
with:
86-
node_image: kindest/node:v1.18.15@sha256:5c1b980c4d0e0e8e7eb9f36f7df525d079a96169c8a8f20d8bd108c0d0889cc4
87-
cluster_name: kubernetes-1.18
82+
node_image: kindest/node:v${{matrix.KubeVersion}}
83+
cluster_name: kubernetes-${{matrix.KubeVersion}}
8884
if: steps.list-changed.outputs.changed == 'true'
8985

90-
- name: Run chart-testing (install) against 1.18
91-
run: ct install --config .ci/ct-config.yaml
86+
- name: Run chart-testing (install) against ${{matrix.KubeVersion}}
87+
run: ct install --config .ci/ct-config.yaml

0 commit comments

Comments
 (0)