-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (69 loc) · 2.48 KB
/
ci.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
85
# Ref: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
name: ci
on:
workflow_dispatch:
pull_request:
branches:
- 'main'
paths:
- charts/**
- .github/workflows/publish.yaml
jobs:
ci:
runs-on: ubuntu-22.04
strategy:
matrix:
# The following strategy matrix is for Minikube.
# Ref: https://kubernetes.io/releases/
k8s: [ "1.32.1" ]
permissions:
contents: read # Required to read repo contents
packages: write # Required to push to GHCR
steps:
- name: Preamble
run: |
whoami
echo github ref $GITHUB_REF
echo workflow $GITHUB_WORKFLOW
echo home $HOME
echo event name $GITHUB_EVENT_NAME
echo workspace $GITHUB_WORKSPACE
df -h
# Ref: https://github.com/actions/checkout
- name: Checkout Source
uses: actions/checkout@v4
with:
fetch-depth: 0
# Ref: https://github.com/helm/chart-testing-action
- name: Install chart-testing
uses: helm/[email protected]
# Ref: https://github.com/helm/chart-testing-action
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --config ct.yaml)
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
fi
- name: Run chart-testing (lint)
run: ct lint --config ct.yaml
# Ref: https://github.com/manusa/actions-setup-minikube
- name: Install Minikube
if: steps.list-changed.outputs.changed == 'true'
uses: manusa/[email protected]
with:
driver: docker
container runtime: docker
minikube version: 'v1.35.0'
kubernetes version: ${{ matrix.k8s }}
start args: "--addons registry --memory 2048 --cpus 2"
github token: ${{ secrets.GHCR_TOKEN }}
# Ref: https://artifacthub.io/packages/helm/cert-manager/cert-manager
- name: Install cert-manager
if: steps.list-changed.outputs.changed == 'true'
run: |
helm install cert-manager jetstack/cert-manager --namespace cert-manager --create-namespace --set crds.enabled=true
# Ref: https://github.com/helm/chart-testing/blob/main/doc/ct_install.md
- name: Run chart-testing (install)
if: steps.list-changed.outputs.changed == 'true'
run: ct install --config ct.yaml --debug