Test Helm Charts #836
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: Test Helm Charts | |
on: | |
workflow_call: | |
inputs: | |
release: | |
description: 'Test a new release process' | |
required: false | |
type: boolean | |
default: false | |
workflow_dispatch: | |
inputs: | |
request-timeout: | |
description: 'Test parameter for different request timeout' | |
required: false | |
default: '15' | |
max-replicas-count: | |
description: 'Test parameter for autoscaling to set maxReplicaCount' | |
required: false | |
default: '10' | |
log-level: | |
description: 'Test parameter for different log level' | |
required: false | |
default: 'FINE' | |
permissions: | |
contents: read | |
jobs: | |
build-and-test: | |
name: Test K8s | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- k8s-version: 'v1.25.16' | |
test-strategy: disabled | |
cluster: 'minikube' | |
helm-version: 'v3.10.3' | |
test-existing-keda: false | |
test-upgrade: true | |
- k8s-version: 'v1.26.15' | |
test-strategy: job | |
cluster: 'minikube' | |
helm-version: 'v3.11.3' | |
test-existing-keda: true | |
test-upgrade: true | |
- k8s-version: 'v1.27.15' | |
test-strategy: deployment | |
cluster: 'minikube' | |
helm-version: 'v3.12.3' | |
test-existing-keda: true | |
test-upgrade: true | |
- k8s-version: 'v1.28.11' | |
test-strategy: job_https | |
cluster: 'minikube' | |
helm-version: 'v3.13.3' | |
test-existing-keda: true | |
test-upgrade: true | |
- k8s-version: 'v1.29.6' | |
test-strategy: job_hostname | |
cluster: 'minikube' | |
helm-version: 'v3.14.4' | |
test-existing-keda: false | |
test-upgrade: true | |
- k8s-version: 'v1.30.2' | |
test-strategy: deployment_https | |
cluster: 'minikube' | |
helm-version: 'v3.15.2' | |
test-existing-keda: false | |
test-upgrade: true | |
env: | |
CLUSTER: ${{ matrix.cluster }} | |
KUBERNETES_VERSION: ${{ matrix.k8s-version }} | |
ARTIFACT_NAME: "${{ matrix.k8s-version }}-${{ matrix.test-strategy }}" | |
HELM_VERSION: ${{ matrix.helm-version }} | |
TEST_EXISTING_KEDA: ${{ matrix.test-existing-keda }} | |
TEST_UPGRADE_CHART: ${{ matrix.test-upgrade }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@main | |
- name: Set up containerd image store feature | |
uses: nick-invision/retry@master | |
with: | |
timeout_minutes: 10 | |
max_attempts: 3 | |
command: | | |
make chart_setup_env | |
make set_containerd_image_store | |
- name: Output Docker info | |
run: docker info | |
- name: Set up Python | |
uses: actions/setup-python@main | |
with: | |
python-version: '3.11' | |
check-latest: true | |
- name: Get branch name (only for push to branch) | |
if: github.event_name == 'push' | |
run: echo "BRANCH=$(echo ${PUSH_BRANCH##*/})" >> $GITHUB_ENV | |
env: | |
PUSH_BRANCH: ${{ github.ref }} | |
- name: Get target branch name (only for PRs) | |
if: github.event_name == 'pull_request' | |
run: echo "BRANCH=$(echo ${TARGET_BRANCH##*/})" >> $GITHUB_ENV | |
env: | |
TARGET_BRANCH: ${{ github.head_ref }} | |
- name: Output branch name | |
run: echo ${BRANCH} | |
- name: Set Selenium base version | |
if: inputs.release != 'true' | |
run: | | |
make set_build_nightly | |
cat .env | xargs -I {} echo {} >> $GITHUB_ENV | |
- name: Sets build date | |
run: | | |
echo "BUILD_DATE=$(date '+%Y%m%d')" >> $GITHUB_ENV | |
echo "IMAGE_REGISTRY=artifactory/selenium" >> $GITHUB_ENV | |
echo "AUTHORS=${AUTHORS}" >> $GITHUB_ENV | |
env: | |
AUTHORS: ${{ vars.AUTHORS || 'SeleniumHQ' }} | |
- name: Build Helm charts | |
run: | | |
BUILD_DATE=${BUILD_DATE} make chart_build | |
echo "CHART_PACKAGE_PATH=$(cat /tmp/selenium_chart_version)" >> $GITHUB_ENV | |
echo "CHART_FILE_NAME=$(basename $(cat /tmp/selenium_chart_version))" >> $GITHUB_ENV | |
- name: Build Docker images | |
uses: nick-invision/retry@master | |
with: | |
timeout_minutes: 12 | |
max_attempts: 3 | |
retry_wait_seconds: 60 | |
command: NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make build | |
- name: Setup Kubernetes cluster | |
uses: nick-invision/retry@master | |
with: | |
timeout_minutes: 10 | |
max_attempts: 3 | |
command: CLUSTER=${CLUSTER} KUBERNETES_VERSION=${KUBERNETES_VERSION} NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} TEST_EXISTING_KEDA=${TEST_EXISTING_KEDA} make chart_cluster_setup | |
- name: Test chart template | |
run: NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make chart_test_template | |
- name: Test set custom CA certificate | |
run: NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make test_custom_ca_cert | |
- name: Set test parameters | |
if: (matrix.test-strategy == 'job' || matrix.test-strategy == 'deployment') && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') | |
run: | | |
echo "AUTOSCALING_POLL_INTERVAL=${AUTOSCALING_POLL_INTERVAL}" >> $GITHUB_ENV | |
echo "SET_MAX_REPLICAS=${SET_MAX_REPLICAS}" >> $GITHUB_ENV | |
echo "LOG_LEVEL=${LOG_LEVEL}" >> $GITHUB_ENV | |
env: | |
AUTOSCALING_POLL_INTERVAL: ${{ github.event.inputs.request-timeout || '15' }} | |
SET_MAX_REPLICAS: ${{ github.event.inputs.max-replicas-count || '10' }} | |
LOG_LEVEL: ${{ github.event.inputs.log-level || 'FINE' }} | |
- name: Test Selenium Grid on Kubernetes ${{ matrix.k8s-version }} with Autoscaling ${{ matrix.test-strategy }} | |
uses: nick-invision/retry@master | |
with: | |
timeout_minutes: 30 | |
max_attempts: 3 | |
command: | | |
NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} TEST_EXISTING_KEDA=${TEST_EXISTING_KEDA} TEST_UPGRADE_CHART=false make chart_test_autoscaling_${{ matrix.test-strategy }} \ | |
&& make test_video_integrity | |
- name: Test chart upgrade | |
if: (matrix.test-upgrade == true) | |
run: | | |
NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} TEST_EXISTING_KEDA=${TEST_EXISTING_KEDA} SET_MAX_REPLICAS=10 TEST_UPGRADE_CHART=${TEST_UPGRADE_CHART} make chart_test_autoscaling_${{ matrix.test-strategy }} | |
- name: Cleanup Kubernetes cluster | |
if: always() | |
run: CLUSTER=${CLUSTER} make chart_cluster_cleanup | |
- name: Upload Helm chart package | |
if: always() | |
uses: actions/upload-artifact@main | |
with: | |
name: "${{ env.ARTIFACT_NAME }}_${{ env.CHART_FILE_NAME }}" | |
path: ${{ env.CHART_PACKAGE_PATH }} | |
- name: Upload chart test artifacts | |
if: always() | |
uses: actions/upload-artifact@main | |
with: | |
name: ${{ env.ARTIFACT_NAME }}-artifacts | |
path: ./tests/tests/ | |
if-no-files-found: ignore | |
- name: Upload test video artifacts | |
if: always() | |
uses: actions/upload-artifact@main | |
with: | |
name: ${{ env.ARTIFACT_NAME }}-videos | |
path: ./tests/videos/ | |
- name: Clean up Docker | |
if: always() | |
run: docker system prune -af |