Skip to content

Install cluster variations as part of CI. #420

Install cluster variations as part of CI.

Install cluster variations as part of CI. #420

Workflow file for this run

name: Lint and Unit Test Charts
on: pull_request
permissions:
contents: read
jobs:
lint-test:
runs-on: ubuntu-latest
services:
cassandra:
image: cassandra:4.1
env:
CASSANDRA_CLUSTER_NAME: test-cluster
CASSANDRA_DC: dc1
CASSANDRA_ENDPOINT_SNITCH: GossipingPropertyFileSnitch
ports:
- 9042:9042
options: >-
--health-cmd "cqlsh -e 'describe cluster'"
--health-interval 10s
--health-timeout 5s
--health-retries 30
postgres:
image: postgres:15
env:
POSTGRES_DB: testdb
POSTGRES_USER: temporal
POSTGRES_PASSWORD: temporal
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U postgres"
--health-interval 10s
--health-timeout 5s
--health-retries 5
elasticsearch:
image: elasticsearch:8.11.0
env:
discovery.type: single-node
xpack.security.enabled: false
ES_JAVA_OPTS: -Xms512m -Xmx512m
ports:
- 9200:9200
options: >-
--health-cmd "curl -f http://localhost:9200/_cluster/health || exit 1"
--health-interval 10s
--health-timeout 5s
--health-retries 10
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v4.2.0
with:
version: v3.14.4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
check-latest: true
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.6.1
- name: Run chart-testing (lint)
run: ct lint --check-version-increment=false --target-branch v1
- name: Install helm-unittest
run: helm plugin install https://github.com/helm-unittest/helm-unittest.git
- name: Run helm-unittest
working-directory: charts/temporal
run: helm unittest .
- name: Create kind cluster
uses: helm/kind-action@v1.13.0
- name: Get Docker host gateway IP
id: docker
run: |
HOST_IP=$(docker network inspect bridge -f '{{range .IPAM.Config}}{{.Gateway}}{{end}}')
echo "host_ip=$HOST_IP" >> $GITHUB_OUTPUT
echo "Docker host IP: $HOST_IP"
- name: Create Kubernetes services and endpoints
run: |
HOST_IP="${{ steps.docker.outputs.host_ip }}"
echo "Using HOST_IP: $HOST_IP"
cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Service
metadata:
name: cassandra
namespace: default
spec:
ports:
- port: 9042
protocol: TCP
targetPort: 9042
clusterIP: None
---
apiVersion: discovery.k8s.io/v1
kind: EndpointSlice
metadata:
name: cassandra-1
namespace: default
labels:
kubernetes.io/service-name: cassandra
addressType: IPv4
ports:
- port: 9042
protocol: TCP
endpoints:
- addresses:
- ${HOST_IP}
EOF
cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Service
metadata:
name: postgres
namespace: default
spec:
ports:
- port: 5432
protocol: TCP
targetPort: 5432
clusterIP: None
---
apiVersion: discovery.k8s.io/v1
kind: EndpointSlice
metadata:
name: postgres-1
namespace: default
labels:
kubernetes.io/service-name: postgres
addressType: IPv4
ports:
- port: 5432
protocol: TCP
endpoints:
- addresses:
- ${HOST_IP}
EOF
cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Service
metadata:
name: mysql
namespace: default
spec:
ports:
- port: 3306
protocol: TCP
targetPort: 3306
clusterIP: None
---
apiVersion: discovery.k8s.io/v1
kind: EndpointSlice
metadata:
name: mysql-1
namespace: default
labels:
kubernetes.io/service-name: mysql
addressType: IPv4
ports:
- port: 3306
protocol: TCP
endpoints:
- addresses:
- ${HOST_IP}
EOF
cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Service
metadata:
name: elasticsearch
namespace: default
spec:
ports:
- port: 9200
protocol: TCP
targetPort: 9200
clusterIP: None
---
apiVersion: discovery.k8s.io/v1
kind: EndpointSlice
metadata:
name: elasticsearch-1
namespace: default
labels:
kubernetes.io/service-name: elasticsearch
addressType: IPv4
ports:
- port: 9200
protocol: TCP
endpoints:
- addresses:
- ${HOST_IP}
EOF
- name: Run chart-testing (install)
run: ct install --target-branch v1