Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add helm local testing github actions #1533

Merged
merged 2 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/check_helm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: check_helm
on:
pull_request:
branches:
- '*'
push:
branches:
- '*'

jobs:
test_helm:
name: Test Helm Chart
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: medyagh/setup-minikube@master
with:
driver: docker
container-runtime: containerd
kubernetes-version: v1.31.0
cpus: max
memory: max

- name: Local Helm Test
run: |
set -xe
helm install -n test test-operator ./deploy/helm/clickhouse-operator/
sleep 10
workflow_count=$(kubectl get all --all-namespaces | grep -c "test-operator")
configmap_count=$(kubectl get cm --all-namespaces | grep -c "test-operator")
if [ "$workflow_count" -lt 4 ]; then
echo "Error: Workload count is less than 4. Current count: $workflow_count"
exit 1
fi

if [ "$configmap_count" -lt 9 ]; then
echo "Error: ConfigMap count is less than 9. Current count: $configmap_count"
exit 1
fi
20 changes: 20 additions & 0 deletions .github/workflows/release_chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,34 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install chart-releaser
run: |
wget https://github.com/helm/chart-releaser/releases/download/v1.4.1/chart-releaser_1.4.1_linux_amd64.tar.gz
tar -zxf chart-releaser_1.4.1_linux_amd64.tar.gz cr
sudo install cr /usr/local/bin/
rm -f cr chart-releaser_1.4.1_linux_amd64.tar.gz

- name: Package Chart
run: cr package deploy/helm/clickhouse-operator

- name: Get Release Assets
run: |
CHART_PATH=$(ls .cr-release-packages/altinity-clickhouse-operator-*.tgz)
ASSET_NAME=$(basename ${CHART_PATH})
ASSET_ID=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/releases/${{ github.event.release.id }}/assets" | \
jq -r ".[] | select(.name == \"$ASSET_NAME\") | .id")

echo "Asset ID is $ASSET_ID"
echo "::set-output name=asset_id::$ASSET_ID"

- name: Delete Existing Release Artifacts
if: steps.get_assets.outputs.asset_id != ''
run: |
curl -X DELETE -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository

- name: Upload Release Artifacts
run: |
CHART_PATH=$(ls .cr-release-packages/altinity-clickhouse-operator-*.tgz)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
with:
driver: docker
container-runtime: containerd
kubernetes-version: v1.30.0
kubernetes-version: v1.31.0
cpus: max
memory: max

Expand Down
Loading