Skip to content

chore: enable ct testing on console #16

chore: enable ct testing on console

chore: enable ct testing on console #16

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Lint and Test Redpanda Charts
on:
pull_request:
branches:
- "**"
paths:
- .github/*.sh
- .github/ct-console.yaml
- .github/kind.yaml
- .github/workflows/pull_requests_console.yaml
- 'charts/console/**'
- '!**/*.md'
jobs:
lint:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- run: |
git checkout main
git checkout -
- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: v3.11.1
- name: Set up chart-testing
uses: joejulian/chart-testing-action@v2.3.1-1
with:
version: v3.8.0-1
- name: Run chart-testing (lint)
run: ct lint --config .github/ct-console.yaml --github-groups
check-values:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- run: |
git checkout main
git checkout -
- name: install dyff
run: curl -Ls https://github.com/homeport/dyff/releases/download/v1.5.6/dyff_1.5.6_linux_amd64.tar.gz | tar xzv dyff
- name: compare console values with main
run: ./dyff --color=off -k between -s <(git show 'origin/main:charts/console/values.yaml') charts/console/values.yaml
test:
needs: lint
name: "${{ matrix.version }}/${{ matrix.testvaluespattern }}: Run ct tests"
strategy:
fail-fast: true
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- run: |
git checkout main
git checkout -
- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: v3.11.1
- name: Set up chart-testing
uses: joejulian/chart-testing-action@v2.3.1-1
with:
version: v3.8.0-1
# we're excluding console from testing until we have a way to test it with Redpanda
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .github/ct-console.yaml)
echo $changed
if [[ -n "$changed" ]]; then
echo changed="true" >> "$GITHUB_OUTPUT"
fi
- name: Create kind cluster
uses: helm/kind-action@v1.5.0
if: steps.list-changed.outputs.changed == 'true'
with:
config: .github/kind.yaml
- name: Check kind config worked
if: steps.list-changed.outputs.changed == 'true'
run: kubectl get nodes
- name: Annotate nodes for rack awareness
if: steps.list-changed.outputs.changed == 'true'
run: .github/annotate_kind_nodes.sh chart-testing
- name: install cert-manager
if: steps.list-changed.outputs.changed == 'true'
run: |
helm repo add jetstack https://charts.jetstack.io &&
helm install cert-manager --namespace cert-manager \
--create-namespace --version v1.11.0 jetstack/cert-manager \
--set installCRDs=true --wait --wait-for-jobs
- name: install prometheus-operator
if: steps.list-changed.outputs.changed == 'true'
run: |
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts &&
helm install prometheus prometheus-community/kube-prometheus-stack \
--namespace prometheus --create-namespace \
--set prometheus.prometheusSpec.serviceMonitorSelectorNilUsesHelmValues=false \
--set nodeExporter.enabled=false \
--set grafana.enabled=false --set kubeStateMetrics.enabled=false --set alertmanager.enabled=false \
--wait --wait-for-jobs
- name: install metallb
if: steps.list-changed.outputs.changed == 'true'
run: |
helm repo add metallb https://metallb.github.io/metallb &&
helm install metallb metallb/metallb -n metallb-system \
--create-namespace --version 0.13.10 --wait --wait-for-jobs
- name: apply metallb resources
if: steps.list-changed.outputs.changed == 'true'
run: |
kubectl -n metallb-system apply -f .github/metallb-config.yaml
# Would like to enable tls but this requires additional work
- name: install redpanda
if: steps.list-changed.outputs.changed == 'true'
run: |
helm repo add redpanda https://charts.redpanda.com &&
helm install redpanda redpanda/redpanda --namespace redpanda \
--set tls.enabled=false \
--create-namespace --wait --wait-for-jobs \
- name: Run chart-testing (install and upgrade)
if: steps.list-changed.outputs.changed == 'true'
run: |
ct install \
--github-groups \
--upgrade \
--config .github/ct-console.yaml \
--helm-extra-set-args=" \
--set=console.config.kafka.tls.enabled=false \
--set=console.config.kafka.brokers={redpanda-0.redpanda.redpanda.svc.cluster.local.:9093,redpanda-1.redpanda.redpanda.svc.cluster.local.:9093,redpanda-2.redpanda.redpanda.svc.cluster.local.:9093} \
--set=console.config.kafka.sasl.enabled=false \
--set=console.config.kafka.schemaRegistry.enabled=true \
--set=console.config.kafka.schemaRegistry.tls.enabled=false \
--set=console.config.kafka.schemaRegistry.urls={http://redpanda-0.redpanda.redpanda.svc.cluster.local.:8081,http://redpanda-1.redpanda.redpanda.svc.cluster.local.:8081,http://redpanda-2.redpanda.redpanda.svc.cluster.local.:8081}" \
--skip-missing-values \
--chart-dirs=charts/console \
--target-branch ${{ github.event.repository.default_branch }}
summary:
if: always()
needs:
- test
runs-on: ubuntu-22.04
steps:
- name: Summarize the results of the test matrix pass/fail
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs)}}