1- name : Lint and Test Helm Charts
1+ name : Test Helm Charts
2+ concurrency :
3+ group : ${{ github.workflow }}
24
35on :
46 push :
810 paths-ignore :
911 - ' **.md'
1012 workflow_dispatch :
13+ inputs :
14+ request-timeout :
15+ description : ' Test parameter for different request timeout'
16+ required : false
17+ default : ' 370'
18+ schedule :
19+ - cron : ' 0 0 * * *'
1120
1221permissions :
1322 contents : read
1423
1524jobs :
1625 build-and-test :
17- name : Test Helm charts
26+ name : Test K8s
1827 runs-on : ubuntu-latest
1928 strategy :
2029 fail-fast : false
2130 matrix :
22- test-strategy : [chart_test, chart_test_parallel_autoscaling, chart_test_https, chart_test_parallel_autoscaling_https]
31+ include :
32+ - k8s-version : ' v1.25.16'
33+ test-strategy : job
34+ cluster : ' kind'
35+ - k8s-version : ' v1.26.14'
36+ test-strategy : deployment
37+ cluster : ' kind'
38+ - k8s-version : ' v1.27.11'
39+ test-strategy : job_https
40+ cluster : ' kind'
41+ - k8s-version : ' v1.28.7'
42+ test-strategy : job_hostname
43+ cluster : ' minikube'
44+ - k8s-version : ' v1.29.2'
45+ test-strategy : deployment_https
46+ cluster : ' minikube'
47+ env :
48+ CLUSTER : ${{ matrix.cluster }}
49+ KUBERNETES_VERSION : ${{ matrix.k8s-version }}
50+ ARTIFACT_NAME : ${{ matrix.k8s-version }}-${{ matrix.test-strategy }}
2351 steps :
24- - uses : actions/checkout@v4
52+ - uses : actions/checkout@main
2553 - name : Output Docker info
2654 run : docker info
2755 - name : Set up Python
28- uses : actions/setup-python@v5.0.0
56+ uses : actions/setup-python@main
2957 with :
3058 python-version : ' 3.11'
3159 check-latest : true
32- - name : Install CA certificates
33- run : |
34- sudo apt install openssl -y
35- sudo apt install ca-certificates -y
36- sudo update-ca-certificates --fresh
3760 - name : Get branch name (only for push to branch)
3861 if : github.event_name == 'push'
3962 run : echo "BRANCH=$(echo ${PUSH_BRANCH##*/})" >> $GITHUB_ENV
@@ -51,36 +74,54 @@ jobs:
5174 echo "BUILD_DATE=$(date '+%Y%m%d')" >> $GITHUB_ENV
5275 echo "IMAGE_REGISTRY=artifactory/selenium" >> $GITHUB_ENV
5376 - name : Setup Kubernetes environment
54- run : make chart_setup_env
55- - name : Build Docker images
56- run : BUILD_ARGS="--build-arg TARGETARCH=amd64" NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make build
57- - name : Build and lint charts
77+ uses : nick-invision/retry@master
78+ with :
79+ timeout_minutes : 10
80+ max_attempts : 3
81+ command : CLUSTER=${CLUSTER} make chart_setup_env
82+ - name : Build Helm charts
5883 run : |
5984 BUILD_DATE=${BUILD_DATE} make chart_build
6085 echo "CHART_PACKAGE_PATH=$(cat /tmp/selenium_chart_version)" >> $GITHUB_ENV
6186 echo "CHART_FILE_NAME=$(basename $(cat /tmp/selenium_chart_version))" >> $GITHUB_ENV
87+ - name : Build Docker images
88+ run : NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make build
6289 - name : Setup Kubernetes cluster
63- run : NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make chart_cluster_setup
64- - name : Test Selenium Grid on Kubernetes
65- uses :
nick-invision/[email protected] 90+ uses : nick-invision/retry@master
91+ with :
92+ timeout_minutes : 10
93+ max_attempts : 3
94+ command : CLUSTER=${CLUSTER} KUBERNETES_VERSION=${KUBERNETES_VERSION} NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make chart_cluster_setup
95+ - name : Test chart template
96+ run : NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make chart_test_template
97+ - name : Test set custom CA certificate
98+ run : NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make test_custom_ca_cert
99+ - name : Set test parameters
100+ if : (matrix.test-strategy == 'job' || matrix.test-strategy == 'deployment') && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
101+ run : |
102+ echo "AUTOSCALING_POLL_INTERVAL=${AUTOSCALING_POLL_INTERVAL}" >> $GITHUB_ENV
103+ env :
104+ AUTOSCALING_POLL_INTERVAL : ${{ github.event.inputs.request-timeout || '370' }}
105+ - name : Test Selenium Grid on Kubernetes ${{ matrix.k8s-version }} with Autoscaling ${{ matrix.test-strategy }}
106+ uses : nick-invision/retry@master
66107 with :
67108 timeout_minutes : 30
68109 max_attempts : 3
69110 command : |
70- NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make ${{ matrix.test-strategy }}
111+ NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make chart_test_autoscaling_ ${{ matrix.test-strategy }}
71112 - name : Cleanup Kubernetes cluster
72113 if : always()
73- run : make chart_cluster_cleanup
114+ run : CLUSTER=${CLUSTER} make chart_cluster_cleanup
74115 - name : Upload Helm chart package
75116 if : always()
76- uses : actions/upload-artifact@v4
117+ uses : actions/upload-artifact@main
77118 with :
78- name : ${{ matrix.test-strategy }}_${{ env.CHART_FILE_NAME }}
119+ name : ${{ env.ARTIFACT_NAME }}_${{ env.CHART_FILE_NAME }}
79120 path : ${{ env.CHART_PACKAGE_PATH }}
80121 - name : Upload chart test artifacts
81122 if : always()
82- uses : actions/upload-artifact@v4
123+ uses : actions/upload-artifact@main
83124 with :
84- name : ${{ matrix.test-strategy }}-artifacts
125+ name : ${{ env.ARTIFACT_NAME }}-artifacts
85126 path : ./tests/tests/
86127 if-no-files-found : ignore
0 commit comments