Skip to content

Commit 3397933

Browse files
authored
Merge pull request #1533 from Altinity/fix_helm_release
Add helm local testing github actions
2 parents 6b2788b + ac2cd32 commit 3397933

File tree

3 files changed

+63
-1
lines changed

3 files changed

+63
-1
lines changed

.github/workflows/check_helm.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: check_helm
2+
on:
3+
pull_request:
4+
branches:
5+
- '*'
6+
push:
7+
branches:
8+
- '*'
9+
10+
jobs:
11+
test_helm:
12+
name: Test Helm Chart
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- uses: medyagh/setup-minikube@master
20+
with:
21+
driver: docker
22+
container-runtime: containerd
23+
kubernetes-version: v1.31.0
24+
cpus: max
25+
memory: max
26+
27+
- name: Local Helm Test
28+
run: |
29+
set -xe
30+
helm install -n test test-operator ./deploy/helm/clickhouse-operator/
31+
sleep 10
32+
workflow_count=$(kubectl get all --all-namespaces | grep -c "test-operator")
33+
configmap_count=$(kubectl get cm --all-namespaces | grep -c "test-operator")
34+
if [ "$workflow_count" -lt 4 ]; then
35+
echo "Error: Workload count is less than 4. Current count: $workflow_count"
36+
exit 1
37+
fi
38+
39+
if [ "$configmap_count" -lt 9 ]; then
40+
echo "Error: ConfigMap count is less than 9. Current count: $configmap_count"
41+
exit 1
42+
fi

.github/workflows/release_chart.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,34 @@ jobs:
1515
uses: actions/checkout@v4
1616
with:
1717
fetch-depth: 0
18+
1819
- name: Install chart-releaser
1920
run: |
2021
wget https://github.com/helm/chart-releaser/releases/download/v1.4.1/chart-releaser_1.4.1_linux_amd64.tar.gz
2122
tar -zxf chart-releaser_1.4.1_linux_amd64.tar.gz cr
2223
sudo install cr /usr/local/bin/
2324
rm -f cr chart-releaser_1.4.1_linux_amd64.tar.gz
25+
2426
- name: Package Chart
2527
run: cr package deploy/helm/clickhouse-operator
28+
29+
- name: Get Release Assets
30+
run: |
31+
CHART_PATH=$(ls .cr-release-packages/altinity-clickhouse-operator-*.tgz)
32+
ASSET_NAME=$(basename ${CHART_PATH})
33+
ASSET_ID=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
34+
"https://api.github.com/repos/${{ github.repository }}/releases/${{ github.event.release.id }}/assets" | \
35+
jq -r ".[] | select(.name == \"$ASSET_NAME\") | .id")
36+
37+
echo "Asset ID is $ASSET_ID"
38+
echo "::set-output name=asset_id::$ASSET_ID"
39+
40+
- name: Delete Existing Release Artifacts
41+
if: steps.get_assets.outputs.asset_id != ''
42+
run: |
43+
curl -X DELETE -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
44+
"https://api.github.com/repos/${{ github.repository
45+
2646
- name: Upload Release Artifacts
2747
run: |
2848
CHART_PATH=$(ls .cr-release-packages/altinity-clickhouse-operator-*.tgz)

.github/workflows/run_tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
with:
4848
driver: docker
4949
container-runtime: containerd
50-
kubernetes-version: v1.30.0
50+
kubernetes-version: v1.31.0
5151
cpus: max
5252
memory: max
5353

0 commit comments

Comments
 (0)