Skip to content

chore: Improve the CI on PRs to be more efficient #39

chore: Improve the CI on PRs to be more efficient

chore: Improve the CI on PRs to be more efficient #39

name: Helm Chart CI (External Scalers - Azure Cosmos DB)
on:
push:
branches:
- main
paths:
- .github/workflows/ci-external-scaler-azure-cosmos-db.yml
- external-scaler-azure-cosmos-db/**
pull_request:
branches:
- main
paths:
- .github/workflows/ci-external-scaler-azure-cosmos-db.yml
- external-scaler-azure-cosmos-db/**
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
lint-helm-3-x:
name: Lint Helm Chart
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Helm install
uses: Azure/setup-helm@v3
- name: Lint 'Azure Cosmos DB external scaler' Helm chart
run: helm lint ./external-scaler-azure-cosmos-db/ --strict
deploy-helm-3-x:
name: Deploy to Kubernetes ${{ matrix.kubernetesVersion }}
needs: lint-helm-3-x
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
kubernetesVersion: [v1.24, v1.23, v1.22, v1.21, v1.20, v1.19, v1.18, v1.17]
include:
# Images are defined on every Kind release
# See https://github.com/kubernetes-sigs/kind/releases
- kubernetesVersion: v1.24
kindImage: kindest/node:v1.24.0@sha256:406fd86d48eaf4c04c7280cd1d2ca1d61e7d0d61ddef0125cb097bc7b82ed6a1
- kubernetesVersion: v1.23
kindImage: kindest/node:v1.23.6@sha256:1af0f1bee4c3c0fe9b07de5e5d3fafeb2eec7b4e1b268ae89fcab96ec67e8355
- kubernetesVersion: v1.22
kindImage: kindest/node:v1.22.9@sha256:6e57a6b0c493c7d7183a1151acff0bfa44bf37eb668826bf00da5637c55b6d5e
- kubernetesVersion: v1.21
kindImage: kindest/node:v1.21.12@sha256:ae05d44cc636ee961068399ea5123ae421790f472c309900c151a44ee35c3e3e
- kubernetesVersion: v1.20
kindImage: kindest/node:v1.20.15@sha256:a6ce604504db064c5e25921c6c0fffea64507109a1f2a512b1b562ac37d652f3
- kubernetesVersion: v1.19
kindImage: kindest/node:v1.19.16@sha256:dec41184d10deca01a08ea548197b77dc99eeacb56ff3e371af3193c86ca99f4
- kubernetesVersion: v1.18
kindImage: kindest/node:v1.18.20@sha256:38a8726ece5d7867fb0ede63d718d27ce2d41af519ce68be5ae7fcca563537ed
- kubernetesVersion: v1.17
kindImage: kindest/node:v1.17.17@sha256:66f1d0d91a88b8a001811e2f1054af60eef3b669a9a74f9b6db871f2f1eeed00
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Helm install
uses: Azure/setup-helm@v3
- name: Create k8s ${{ matrix.kubernetesVersion }} Kind Cluster
uses: helm/[email protected]
with:
version: v0.13.0
node_image: ${{ matrix.kindImage }}
- name: Show Kubernetes version
run: |
kubectl version
- name: Show Kubernetes nodes
run: |
kubectl get nodes -o wide
- name: Show Helm version
run: |
helm version
- name: Create KEDA namespace
run: kubectl create ns keda
- name: Template Helm chart
run: helm template test-release ./external-scaler-azure-cosmos-db/ --namespace test-namespace
- name: Install Helm chart
run: helm install test-release ./external-scaler-azure-cosmos-db/ --namespace test-namespace --create-namespace --wait --timeout=2m
- name: Show Kubernetes resources
run: kubectl get all --namespace keda
if: always()
- name: Get 'Azure Cosmos DB external scaler' service
run: kubectl get service external-scaler-azure-cosmos-db --namespace=test-namespace
- name: Get 'Azure Cosmos DB external scaler' deployment
run: kubectl get deployment external-scaler-azure-cosmos-db --namespace=test-namespace
- name: Uninstall 'Azure Cosmos DB external scaler' Helm chart
run: helm uninstall test-release --namespace test-namespace