-
Notifications
You must be signed in to change notification settings - Fork 0
138 lines (115 loc) · 3.3 KB
/
Copy pathhelm.yml
File metadata and controls
138 lines (115 loc) · 3.3 KB
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
name: Helm
on:
push:
branches:
- main
paths:
- "deploy/charts/**"
pull_request:
paths:
- "deploy/charts/**"
env:
HELM_VERSION: "v3.10.2"
permissions:
contents: write
jobs:
lint-crds:
name: CRDs
runs-on: ubuntu-latest
env:
CT_CONFIG: hack/config/chart-testing/mariadb-enterprise-operator-crds.yaml
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Helm
uses: azure/setup-helm@v4
with:
version: ${{ env.HELM_VERSION }}
- uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.6.1
- name: List changed
id: list-changed
run: |
changed=$(ct list-changed --config $CT_CONFIG)
if [[ -n "$changed" ]]; then
echo "changed=true" >> $GITHUB_OUTPUT
fi
- name: Lint
if: steps.list-changed.outputs.changed == 'true'
run: ct lint --config $CT_CONFIG
- name: Cluster
if: steps.list-changed.outputs.changed == 'true'
run: make cluster
- name: Test install
if: steps.list-changed.outputs.changed == 'true'
run: ct install --config $CT_CONFIG
lint-operator:
name: Operator
runs-on: ubuntu-latest
env:
CT_CONFIG: hack/config/chart-testing/mariadb-enterprise-operator.yaml
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Helm
uses: azure/setup-helm@v4
with:
version: ${{ env.HELM_VERSION }}
- uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.6.1
- name: List changed
id: list-changed
run: |
changed=$(ct list-changed --config $CT_CONFIG)
if [[ -n "$changed" ]]; then
echo "changed=true" >> $GITHUB_OUTPUT
fi
- name: Lint
if: steps.list-changed.outputs.changed == 'true'
run: ct lint --config $CT_CONFIG
- name: Cluster
if: steps.list-changed.outputs.changed == 'true'
run: make cluster
- name: Test install
if: steps.list-changed.outputs.changed == 'true'
run: ct install --config $CT_CONFIG --helm-extra-set-args "--set=crds.enabled=true"
release:
name: Release
runs-on: ubuntu-latest
needs:
- lint-crds
- lint-operator
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: "${{ secrets.GITHUB_TOKEN }}"
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Install Helm
uses: azure/setup-helm@v4
- name: Run chart-releaser
id: chart-releaser
uses: helm/chart-releaser-action@v1.7.0
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
with:
charts_dir: deploy/charts
skip_existing: "true"
pages_branch: gh-pages
packages_with_index: true
mark_as_latest: false