-
Notifications
You must be signed in to change notification settings - Fork 3
90 lines (73 loc) · 2.37 KB
/
chart-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
85
86
87
88
89
90
name: Chart testing
on:
pull_request:
paths: ['charts/**']
types:
- opened
- edited
- reopened
- synchronize
permissions:
contents: read
jobs:
chart-linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
name: Checkout Conduktor Charts
with:
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Fetch history
run: git fetch --prune --unshallow
- name: Set up chart-testing
uses: helm/[email protected]
- name: Run chart-testing (lint)
run: ct lint --config .github/ct-lint-config.yaml
chart-testing:
runs-on: [ ubuntu-latest ]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Fetch history
run: git fetch --prune --unshallow
- name: Install helm
uses: azure/setup-helm@v3
with:
version: 'v3.10.1'
- name: Set up chart-testing
uses: helm/[email protected]
- name: Install K3D
shell: bash
env:
K3D_INSTALL_DIR: ${{ github.workspace }}/.github/.bin
K3D_VERSION: "5.4.7"
run: |
mkdir .github/.bin
export PATH="${{ github.workspace }}/.github/.bin:$PATH"
echo "PATH=${{ github.workspace }}/.github/.bin:$PATH" >> $GITHUB_ENV
echo "Installing k3d"
curl -s https://raw.githubusercontent.com/k3d-io/k3d/v${K3D_VERSION}/install.sh | USE_SUDO="false" bash
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --config .github/ct-config.yaml --target-branch main)
if [[ -n "$changed" ]]; then
echo "changed=true" >> $GITHUB_OUTPUT
fi
- name: Install helm dependencies
if: steps.list-changed.outputs.changed == 'true'
run: make helm-deps
- name: Create k3d cluster
if: steps.list-changed.outputs.changed == 'true'
run: |
make k3d-ci-up
kubectl create ns ct || true
- name: Run chart-testing (install)
run: ct install --config .github/ct-config.yaml
if: steps.list-changed.outputs.changed == 'true'
- name: Create k3d cluster
if: always()
run: make k3d-down