-
Notifications
You must be signed in to change notification settings - Fork 142
84 lines (70 loc) · 2.76 KB
/
helm-test.yaml
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
80
81
82
83
84
name: helm-test
on:
pull_request:
branches:
- 'main'
paths:
- 'charts/tofu-controller/**'
- '.github/workflows/helm-test.yaml'
permissions: read-all
jobs:
lint-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.0.0
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v3.5.0
with:
version: latest
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: "3.10"
- name: Set up chart-testing
uses: helm/chart-testing-action@e6669bcd63d7cb57cb4380c33043eebe5d111992 # v2.6.1
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --config ct.yaml)
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Run docs-testing (helm-docs)
id: helm-docs
run: |
make helm-docs
if [[ $(git diff --stat) != '' ]]; then
echo -e '\033[0;31mDocumentation outdated! (Run make helm-docs locally and commit)\033[0m ❌'
git diff --color
exit 1
else
echo -e '\033[0;32mDocumentation up to date\033[0m ✔'
fi
if: steps.list-changed.outputs.changed == 'true'
- name: Run chart-testing (lint)
run: ct lint --check-version-increment=false --config ct.yaml
if: steps.list-changed.outputs.changed == 'true'
- name: Build the tofu-controller container image
run: |
make docker-buildx MANAGER_IMG=test/tofu-controller RUNNER_IMG=test/tf-runner TAG=ct \
BUILD_ARGS="--load"
if: steps.list-changed.outputs.changed == 'true'
- name: Create kind cluster
uses: helm/kind-action@0025e74a8c7512023d06dc019c617aa3cf561fde # v1.10.0
if: steps.list-changed.outputs.changed == 'true'
- name: Load test images into KIND
run: |
kind load docker-image --name=chart-testing test/tofu-controller:ct
kind load docker-image --name=chart-testing test/tf-runner:ct
if: steps.list-changed.outputs.changed == 'true'
- name: Install Flux CLI
uses: fluxcd/flux2/action@896e0fa46d5107a05e953dd0a5261d78a145ec8c # main
if: steps.list-changed.outputs.changed == 'true'
- name: Install Source controller
run: flux install --components=source-controller
if: steps.list-changed.outputs.changed == 'true'
- name: Run chart-testing (install)
run: ct install --config ct.yaml
if: steps.list-changed.outputs.changed == 'true'