chore: rename Chart.yaml template to Chart.template.yaml for clarity #920
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow installs 1 instance of sparrow and | |
# verify the API output | |
name: End2End Testing | |
on: | |
push: | |
jobs: | |
end2end: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v4 | |
# We need to fetch tags because our snapshot artifacts are named like this <tag>-commit-<short-commit>. | |
# We don't use checkout/fetch-tags: true because it's broken. | |
# For more information see: https://github.com/actions/checkout/issues/1471 | |
- name: Fetch tags explicitly | |
run: git fetch --prune --unshallow --tags | |
- name: Set up K3S | |
uses: debianmaster/actions-k3s@master | |
id: k3s | |
with: | |
version: "v1.31.2-k3s1" | |
- name: Check Cluster | |
run: | | |
kubectl get nodes | |
- name: Check Coredns Deployment | |
run: | | |
kubectl -n kube-system rollout status deployment/coredns --timeout=60s | |
STATUS=$(kubectl -n kube-system get deployment coredns -o jsonpath={.status.readyReplicas}) | |
if [[ $STATUS -ne 1 ]] | |
then | |
echo "Deployment coredns not ready" | |
kubectl -n kube-system get events | |
exit 1 | |
else | |
echo "Deployment coredns OK" | |
fi | |
- name: Check Metricsserver Deployment | |
run: | | |
kubectl -n kube-system rollout status deployment/metrics-server --timeout=60s | |
STATUS=$(kubectl -n kube-system get deployment metrics-server -o jsonpath={.status.readyReplicas}) | |
if [[ $STATUS -ne 1 ]] | |
then | |
echo "Deployment metrics-server not ready" | |
kubectl -n kube-system get events | |
exit 1 | |
else | |
echo "Deployment metrics-server OK" | |
fi | |
- name: Setup Helm | |
run: | | |
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash | |
helm version | |
- name: Get Image Tag | |
id: version | |
run: echo "value=$(git describe --tags --abbrev=0)-commit-$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
- name: Install Sparrow | |
run: | | |
cd chart && make package | |
version="$(make WITH_V=0 version)" | |
cd .. | |
helm upgrade -i sparrow ./chart/sparrow-${version}.tgz \ | |
--atomic \ | |
--timeout 300s \ | |
--set image.tag=${{ steps.version.outputs.value }} \ | |
--set sparrowConfig.name=the-sparrow.com \ | |
--set sparrowConfig.loader.type=file \ | |
--set sparrowConfig.loader.interval=5s \ | |
--set sparrowConfig.loader.file.path=/config/.sparrow.yaml \ | |
--set checksConfig.health.interval=1s \ | |
--set checksConfig.health.timeout=1s | |
- name: Check Pods | |
run: | | |
kubectl get pods | |
- name: Wait for Sparrow | |
run: | | |
sleep 60 | |
- name: Healthcheck | |
run: | | |
kubectl create job curl --image=quay.io/curl/curl:latest -- curl -f -v -H 'Content-Type: application/json' http://sparrow:8080/v1/metrics/health | |
kubectl wait --for=condition=complete job/curl | |
STATUS=$(kubectl get job curl -o jsonpath={.status.succeeded}) | |
if [[ $STATUS -ne 1 ]] | |
then | |
echo "Job failed" | |
kubectl logs -ljob-name=curl | |
kubectl delete job curl | |
exit 1 | |
else | |
echo "Job OK" | |
kubectl delete job curl | |
fi |