chore: modify development cluster setup to support loadbalancer #1874
Workflow file for this run
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
name: Lint and test charts - current | |
on: pull_request | |
jobs: | |
yamllint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Helm | |
run: | | |
cd /tmp | |
curl -fsSLo get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | |
chmod 700 get_helm.sh | |
./get_helm.sh | |
- name: Add dependency chart repos | |
run: | | |
helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com | |
helm repo add lagoon https://uselagoon.github.io/lagoon-charts/ | |
helm repo add amazeeio https://amazeeio.github.io/charts/ | |
helm repo add nats https://nats-io.github.io/k8s/helm/charts/ | |
helm repo add kube-logging https://kube-logging.github.io/helm-charts | |
- name: Generate helm templates | |
run: | | |
cd charts | |
# hacky workaround for lagoon-test templated values | |
tests=[foo,bar] envsubst '$tests' < lagoon-test/ci/linter-values.yaml.tpl > lagoon-test/ci/linter-values.yaml | |
for chart in *; do | |
helm dependency build $chart | |
mkdir -p /tmp/charts/$chart | |
helm template $chart $chart \ | |
--values $chart/ci/linter-values.yaml \ | |
--output-dir /tmp/charts/$chart | |
done | |
# workaround until logging-operator templates are fixed: | |
# https://github.com/banzaicloud/logging-operator/pull/792 | |
rm -rf /tmp/charts/lagoon-logging/lagoon-logging/charts/logging-operator | |
# workaround until nats templates are fixed | |
rm -rf /tmp/charts/lagoon-remote/lagoon-remote/charts/nats | |
rm -rf /tmp/charts/lagoon-core/lagoon-core/charts/nats | |
- name: Install YAMLlint | |
run: sudo apt-get -y install yamllint | |
- name: Lint the templates | |
run: | | |
set -euo pipefail | |
cat > .yamllint <<EOF | |
extends: default | |
rules: | |
indentation: | |
indent-sequences: consistent | |
line-length: disable | |
EOF | |
yamllint -f parsable /tmp/charts | awk -F: '{print; system("sed \"" $2 "q;d\" " $1)}' | |
# runs for all charts other than lagoon-test, which is excluded in | |
# default.ct.yaml | |
lint-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: "0" | |
- name: Set up chart-testing dependencies | |
run: sudo apt-get -y install python3-wheel | |
- name: Set up chart-testing | |
uses: helm/[email protected] | |
- name: Run chart-testing (list-changed) | |
id: list-changed | |
run: | | |
changed=$(ct list-changed --config ./default.ct.yaml) | |
if [[ "$changed" ]]; then | |
echo "changed=true" >> $GITHUB_OUTPUT | |
echo "$changed" | |
fi | |
- name: Run chart-testing (lint) | |
run: ct lint --config ./default.ct.yaml | |
- name: Create kind cluster | |
uses: helm/[email protected] | |
with: | |
version: v0.22.0 | |
node_image: kindest/node:v1.28.7@sha256:9bc6c451a289cf96ad0bbaf33d416901de6fd632415b076ab05f5fa7e4f65c58 | |
kubectl_version: v1.28.7 | |
if: | | |
(steps.list-changed.outputs.changed == 'true') || | |
(contains(github.event.pull_request.labels.*.name, 'needs-testing')) | |
- name: Run chart-testing (install) | |
run: ct install --config ./default.ct.yaml --helm-extra-args "--timeout 30m" | |
- name: Run chart-testing (needs-testing) | |
run: ct install --config ./default.ct.yaml --helm-extra-args "--timeout 30m" --all | |
if: | | |
(contains(github.event.pull_request.labels.*.name, 'needs-testing')) | |
artifacthub-changelog: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: "0" | |
- name: Install gojq | |
run: | | |
cd /tmp | |
curl -sSLO https://github.com/itchyny/gojq/releases/download/v0.12.13/gojq_v0.12.13_linux_amd64.tar.gz | |
tar -xf ./gojq_v0.12.13_linux_amd64.tar.gz | |
sudo cp /tmp/gojq_v0.12.13_linux_amd64/gojq /usr/local/bin/gojq | |
- name: Run artifacthub.io changelog check | |
run: | | |
for chartyaml in $(git diff --name-only origin/main | awk -F/ '/^charts\// { printf "%s/%s/%s\n",$1,$2,"Chart.yaml" }' | sort -u); do | |
if diff <(gojq -r --yaml-input '.annotations."artifacthub.io/changes"' <(git show HEAD:$chartyaml)) <(gojq -r --yaml-input '.annotations."artifacthub.io/changes"' <(git show origin/main:$chartyaml)); then | |
echo "$chartyaml artifacthub.io changelog needs an update!" | |
exit 1 | |
fi | |
done |