Skip to content

Commit 52ef5a4

Browse files
authored
Merge branch 'main' into spark-history
2 parents 7eee34a + 61d612e commit 52ef5a4

25 files changed

+6156
-4
lines changed

.ct.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
lint-conf: .lintconf.yaml
2+
remote: origin
3+
target-branch: main
4+
chart-dirs:
5+
- .
6+
chart-repos:
7+
- superset=https://apache.github.io/superset
8+
- bitnami=https://charts.bitnami.com/bitnami
9+
debug: true
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#
2+
# Copyright 2024 tosit.io
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
name: Free disk space
18+
description: Free Github runnner disk space
19+
20+
runs:
21+
using: composite
22+
steps:
23+
- name: Free Disk Space (Ubuntu)
24+
uses: jlumbroso/free-disk-space@main
25+
with:
26+
# this might remove tools that are actually needed,
27+
# if set to "true" but frees about 6 GB
28+
tool-cache: false
29+
30+
# all of these default to true, but feel free to set to
31+
# "false" if necessary for your workflow
32+
android: true
33+
dotnet: true
34+
haskell: true
35+
large-packages: true
36+
docker-images: true
37+
swap-storage: true
38+
39+
40+

.github/actions/helm-docs/action.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#
2+
# Copyright 2024 tosit.io
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
name: helm-docs
18+
description: Auto-generates documentation from helm chart
19+
20+
inputs:
21+
# chart_name:
22+
# description: Helm chart name
23+
# required: true
24+
helm_docs_version:
25+
description: helm-docs version
26+
required: false
27+
default: "1.13.1"
28+
29+
runs:
30+
using: composite
31+
steps:
32+
33+
- name: Install helm-docs
34+
run: |
35+
wget https://github.com/norwoodj/helm-docs/releases/download/v${{ inputs.helm_docs_version }}/helm-docs_${{ inputs.helm_docs_version }}_Linux_x86_64.deb
36+
sudo apt install ./helm-docs_${{ inputs.helm_docs_version }}_Linux_x86_64.deb
37+
rm -f helm-docs_${{ inputs.helm_docs_version }}_Linux_x86_64.deb
38+
shell: bash
39+
40+
41+
42+
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#
2+
# Copyright 2024 tosit.io
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
name: Setup kind
18+
description: Deploy kind cluster
19+
20+
runs:
21+
using: composite
22+
steps:
23+
- name: Create k8s Kind Cluster
24+
uses: helm/kind-action@v1
25+
with:
26+
# https://github.com/helm/kind-action?tab=readme-ov-file#inputs
27+
verbosity: 10
28+
cluster_name: "kind-ci-${{ github.job }}"
29+
ignore_failed_clean: true # Ignore the post delete cluster action failing
30+
wait: "180s" # Max timeout to wait Kind becomes ready
31+
32+
- name: Print Kind cluster state
33+
run: |
34+
kubectl cluster-info
35+
kubectl get pods -A
36+
kubectl describe node
37+
shell: bash

.github/workflows/ci.yml

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
#
2+
# Copyright 2024 tosit.io
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
name: ci
18+
19+
on:
20+
pull_request:
21+
branches:
22+
- main
23+
paths:
24+
- ".github/workflows/**"
25+
- ".github/actions/**"
26+
27+
- ".ct.yml"
28+
- ".lintconf.yaml"
29+
30+
- "**/**"
31+
32+
- "!README.md"
33+
- "!**/README.md"
34+
- "!docs/**"
35+
36+
push:
37+
branches:
38+
- '**'
39+
- '!gh-pages'
40+
paths:
41+
- ".github/workflows/**"
42+
- ".github/actions/**"
43+
44+
- ".ct.yml"
45+
- ".lintconf.yaml"
46+
47+
- "**/**"
48+
49+
- "!README.md"
50+
- "!**/README.md"
51+
- "!docs/**"
52+
53+
workflow_dispatch:
54+
55+
permissions:
56+
contents: write
57+
58+
# https://docs.github.com/en/actions/using-jobs/using-concurrency
59+
concurrency:
60+
# Only cancel in-progress jobs or runs for the current workflow - matches against branch & tags
61+
group: ${{ github.workflow }}-${{ github.ref }}
62+
cancel-in-progress: true
63+
64+
defaults:
65+
run:
66+
shell: bash
67+
68+
jobs:
69+
70+
helm-lint:
71+
runs-on: "ubuntu-latest"
72+
steps:
73+
- name: Checkout Repo ⚡️
74+
uses: actions/checkout@v4
75+
with:
76+
fetch-depth: 0
77+
78+
- name: Setup helm
79+
uses: azure/setup-helm@v4.2.0
80+
with:
81+
version: v3.15.1
82+
83+
- uses: actions/setup-python@v5
84+
with:
85+
python-version: '3.10'
86+
87+
- name: Set up chart-testing
88+
uses: helm/chart-testing-action@v2.6.1
89+
90+
- name: Run chart-testing (list-changed) ✅
91+
id: list-changed
92+
run: |
93+
changed=$(ct list-changed --config .ct.yml --print-config)
94+
if [[ -n "$changed" ]]; then
95+
echo "list_changed=$(echo ${changed} | tr -d \')" >> "$GITHUB_OUTPUT"
96+
echo "changed=true" >> "$GITHUB_OUTPUT"
97+
fi
98+
99+
- name: Run chart-testing (lint) ✅
100+
if: steps.list-changed.outputs.changed == 'true'
101+
run: ct lint --config .ct.yml --check-version-increment=false --print-config
102+
103+
- name: Free up disk space 🧹
104+
if: steps.list-changed.outputs.changed == 'true'
105+
uses: ./.github/actions/free-disk-space
106+
107+
- name: Set up kind cluster ✅
108+
if: steps.list-changed.outputs.changed == 'true'
109+
uses: ./.github/actions/setup-kind
110+
111+
- name: Run chart-testing (install) ✅
112+
if: steps.list-changed.outputs.changed == 'true'
113+
run: ct install --config .ct.yml --print-config
114+
115+
- name: Install helm-docs
116+
if: steps.list-changed.outputs.changed == 'true'
117+
uses: ./.github/actions/helm-docs
118+
119+
- name: Generate helm docs
120+
if: steps.list-changed.outputs.changed == 'true'
121+
run: |
122+
echo "Generate docs from charts: ${{ steps.list-changed.outputs.list_changed }}"
123+
helm-docs --chart-to-generate $(echo "${{ steps.list-changed.outputs.list_changed }}" | tr " " ",")
124+
125+
- name: Commit helm docs changes
126+
# Github token from forked repo does not have permission to push to target repo
127+
# Skip the step for PRs from forked repos
128+
if: |
129+
${{ steps.list-changed.outputs.changed == 'true'
130+
&& ((github.event_name == 'push') || (github.event_name == 'pull_request'
131+
&& github.event.pull_request.head.repo.full_name == github.repository)) }}
132+
uses: EndBug/add-and-commit@v9
133+
with:
134+
pull: "--rebase --autostash"
135+
add: "**/README.md"
136+
message: '[helm-docs] Update readme'
137+
author_name: github-actions[bot]
138+
author_email: 41898282+github-actions[bot]@users.noreply.github.com
139+

.github/workflows/publish.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
#
2+
# Copyright 2024 tosit.io
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
name: publish
18+
19+
on:
20+
workflow_call:
21+
inputs:
22+
chart_name:
23+
description: Helm chart version
24+
required: true
25+
type: string
26+
version:
27+
description: Helm chart version
28+
required: true
29+
type: string
30+
31+
env:
32+
release_tag_name: ${{ inputs.chart_name }}-v${{ inputs.version }}
33+
chart_package_name: ${{ inputs.chart_name }}-${{ inputs.version }}.tgz
34+
cr_release_name_template: "{{ .Name }}-v{{ .Version }}"
35+
36+
defaults:
37+
run:
38+
shell: bash
39+
40+
jobs:
41+
42+
helm-chart-publish:
43+
name: "Publish (${{ inputs.chart_name }}-${{ inputs.version }})"
44+
runs-on: "ubuntu-latest"
45+
steps:
46+
- name: Checkout release tag ${{ env.release_tag_name }} ⚡️
47+
uses: actions/checkout@v4
48+
with:
49+
fetch-depth: 0
50+
ref: ${{ env.release_tag_name }}
51+
52+
- name: Setup helm
53+
uses: azure/setup-helm@v4.2.0
54+
with:
55+
version: v3.15.1
56+
57+
- name: Add chart dependencies
58+
run: |
59+
helm repo add superset https://apache.github.io/superset
60+
helm repo add bitnami https://charts.bitnami.com/bitnami
61+
helm repo update
62+
63+
- name: Install chart-releaser (cr)
64+
uses: helm/chart-releaser-action@v1.6.0
65+
with:
66+
install_only: true
67+
68+
- name: Package helm chart ${{ inputs.chart_name }} (${{ inputs.version }})
69+
run: |
70+
helm dependency build ${{ inputs.chart_name }}
71+
cr package ${{ inputs.chart_name }}
72+
73+
- name: Upload Chart package to Github release
74+
run: |
75+
gh release upload ${{ env.release_tag_name }} ./.cr-release-packages/${{ env.chart_package_name }} --clobber
76+
env:
77+
GH_TOKEN: ${{ github.token }}
78+
shell: bash
79+
80+
- name: Checkout gh-pages branch ⚡️
81+
uses: actions/checkout@v4
82+
with:
83+
fetch-depth: 0
84+
ref: gh-pages
85+
path: gh-pages
86+
87+
- name: Update helm chart index.yaml
88+
run: |
89+
cr index -i gh-pages/index.yaml \
90+
-r ${GITHUB_REPOSITORY#*/} \
91+
-o ${{ github.repository_owner }} \
92+
--release-name-template "${{ env.cr_release_name_template }}"
93+
shell: bash
94+
95+
- name: Commit helm chart index.yaml changes into gh-pages branch
96+
uses: EndBug/add-and-commit@v9
97+
with:
98+
cwd: gh-pages
99+
pull: "--rebase --autostash"
100+
message: '[${{ inputs.chart_name }}-${{ inputs.version }}] - Update index.yaml'
101+
author_name: github-actions[bot]
102+
author_email: 41898282+github-actions[bot]@users.noreply.github.com

0 commit comments

Comments
 (0)