Skip to content

Commit f39eefb

Browse files
committed
Add EKS Test Cluster Name Action and update workflows
- Introduced a new GitHub Action to generate standardized EKS test cluster names based on test type, platform, test name, and run ID. - Updated multiple workflows to utilize the new action for setting test cluster names, ensuring unique naming conventions across different platforms and test types. - Removed legacy inline cluster name setting to streamline the process and improve maintainability.
1 parent b848760 commit f39eefb

15 files changed

+202
-42
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: 'Set EKS Test Cluster Name'
2+
description: 'Generate a shortened, standardized EKS test cluster name'
3+
inputs:
4+
test-type:
5+
description: 'Type of test (e.g., smoke, integration)'
6+
required: true
7+
platform:
8+
description: 'Platform variant (e.g., distroless, arm-ubuntu, arm-rhel, arm-al2023, helm, namespace, nightly, manual, or empty for standard)'
9+
required: false
10+
default: ''
11+
test-name:
12+
description: 'Test name from matrix (e.g., basic, managerappframeworkc3)'
13+
required: true
14+
run-id:
15+
description: 'GitHub run ID for uniqueness'
16+
required: true
17+
outputs:
18+
cluster-name:
19+
description: 'The generated cluster name'
20+
value: ${{ steps.generate-name.outputs.cluster_name }}
21+
runs:
22+
using: "composite"
23+
steps:
24+
- name: Generate cluster name
25+
id: generate-name
26+
shell: bash
27+
run: |
28+
TEST_NAME="${{ inputs.test-name }}"
29+
30+
# Shorten long test names
31+
case "$TEST_NAME" in
32+
managerappframeworkc3) TEST_NAME="mgr-appfw-c3" ;;
33+
managerappframeworkm4) TEST_NAME="mgr-appfw-m4" ;;
34+
appframeworksS1) TEST_NAME="appfw-s1" ;;
35+
managersecret) TEST_NAME="mgr-secret" ;;
36+
managermc) TEST_NAME="mgr-mc" ;;
37+
esac
38+
39+
# Build cluster name based on platform
40+
if [ -z "${{ inputs.platform }}" ]; then
41+
# Standard platform (no platform suffix)
42+
CLUSTER_NAME="eks-test-${{ inputs.test-type }}-${TEST_NAME}-${{ inputs.run-id }}"
43+
else
44+
# Platform-specific
45+
CLUSTER_NAME="eks-test-${{ inputs.test-type }}-${{ inputs.platform }}-${TEST_NAME}-${{ inputs.run-id }}"
46+
fi
47+
48+
echo "cluster_name=${CLUSTER_NAME}" >> $GITHUB_OUTPUT
49+
echo "Generated cluster name: ${CLUSTER_NAME}"
50+

.github/workflows/arm-AL2023-build-test-push-workflow-AL2023.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,19 @@ jobs:
146146
ARM64: "true"
147147
GRAVITON_TESTING: "true"
148148
steps:
149-
- name: Set Test Cluster Name
150-
run: |
151-
echo "TEST_CLUSTER_NAME=eks-test-cluster-smoke-arm-AL2023-${{ matrix.test }}-$GITHUB_RUN_ID" >> $GITHUB_ENV
152149
- name: Chekcout code
153150
uses: actions/checkout@v2
151+
- name: Set Test Cluster Name
152+
id: set-cluster-name
153+
uses: ./.github/actions/set-cluster-name
154+
with:
155+
test-type: smoke
156+
platform: arm-al2023
157+
test-name: ${{ matrix.test }}
158+
run-id: ${{ github.run_id }}
159+
- name: Export cluster name to environment
160+
run: |
161+
echo "TEST_CLUSTER_NAME=${{ steps.set-cluster-name.outputs.cluster-name }}" >> $GITHUB_ENV
154162
- name: Dotenv Action
155163
id: dotenv
156164
uses: falti/dotenv-action@d4d12eaa0e1dd06d5bdc3d7af3bf4c8c93cb5359

.github/workflows/arm-AL2023-int-test-workflow.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,6 @@ jobs:
9494
ARM64: "true"
9595
GRAVITON_TESTING: "true"
9696
steps:
97-
- name: Set Test Cluster Name
98-
run: |
99-
echo "TEST_CLUSTER_NAME=eks-test-cluster-integration-arm-AL2023-${{ matrix.test }}-$GITHUB_RUN_ID" >> $GITHUB_ENV
10097
- name: Set Test Cluster Nodes and Parallel Runs
10198
run: >-
10299
if grep -q "appframework" <<< "${{ matrix.test }}"; then
@@ -105,6 +102,17 @@ jobs:
105102
fi
106103
- name: Checkcout code
107104
uses: actions/checkout@v2
105+
- name: Set Test Cluster Name
106+
id: set-cluster-name
107+
uses: ./.github/actions/set-cluster-name
108+
with:
109+
test-type: integration
110+
platform: arm-al2023
111+
test-name: ${{ matrix.test }}
112+
run-id: ${{ github.run_id }}
113+
- name: Export cluster name to environment
114+
run: |
115+
echo "TEST_CLUSTER_NAME=${{ steps.set-cluster-name.outputs.cluster-name }}" >> $GITHUB_ENV
108116
- name: Dotenv Action
109117
id: dotenv
110118
uses: falti/dotenv-action@d4d12eaa0e1dd06d5bdc3d7af3bf4c8c93cb5359

.github/workflows/arm-RHEL-build-test-push-workflow.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,6 @@ jobs:
9494
ARM64: "true"
9595
GRAVITON_TESTING: "true"
9696
steps:
97-
- name: Set Test Cluster Name
98-
run: |
99-
echo "TEST_CLUSTER_NAME=eks-test-cluster-smoke-arm-RHEL-${{ matrix.test }}-$GITHUB_RUN_ID" >> $GITHUB_ENV
10097
- name: Set Test Cluster Nodes and Parallel Runs
10198
run: >-
10299
if grep -q "appframework" <<< "${{ matrix.test }}"; then
@@ -105,6 +102,17 @@ jobs:
105102
fi
106103
- name: Checkcout code
107104
uses: actions/checkout@v2
105+
- name: Set Test Cluster Name
106+
id: set-cluster-name
107+
uses: ./.github/actions/set-cluster-name
108+
with:
109+
test-type: smoke
110+
platform: arm-rhel
111+
test-name: ${{ matrix.test }}
112+
run-id: ${{ github.run_id }}
113+
- name: Export cluster name to environment
114+
run: |
115+
echo "TEST_CLUSTER_NAME=${{ steps.set-cluster-name.outputs.cluster-name }}" >> $GITHUB_ENV
108116
- name: Dotenv Action
109117
id: dotenv
110118
uses: falti/dotenv-action@d4d12eaa0e1dd06d5bdc3d7af3bf4c8c93cb5359

.github/workflows/arm-RHEL-int-test-workflow.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,6 @@ jobs:
9494
ARM64: "true"
9595
GRAVITON_TESTING: "true"
9696
steps:
97-
- name: Set Test Cluster Name
98-
run: |
99-
echo "TEST_CLUSTER_NAME=eks-test-cluster-integration-arm-RHEL-${{ matrix.test }}-$GITHUB_RUN_ID" >> $GITHUB_ENV
10097
- name: Set Test Cluster Nodes and Parallel Runs
10198
run: >-
10299
if grep -q "appframework" <<< "${{ matrix.test }}"; then
@@ -105,6 +102,17 @@ jobs:
105102
fi
106103
- name: Checkcout code
107104
uses: actions/checkout@v2
105+
- name: Set Test Cluster Name
106+
id: set-cluster-name
107+
uses: ./.github/actions/set-cluster-name
108+
with:
109+
test-type: integration
110+
platform: arm-rhel
111+
test-name: ${{ matrix.test }}
112+
run-id: ${{ github.run_id }}
113+
- name: Export cluster name to environment
114+
run: |
115+
echo "TEST_CLUSTER_NAME=${{ steps.set-cluster-name.outputs.cluster-name }}" >> $GITHUB_ENV
108116
- name: Dotenv Action
109117
id: dotenv
110118
uses: falti/dotenv-action@d4d12eaa0e1dd06d5bdc3d7af3bf4c8c93cb5359

.github/workflows/arm-Ubuntu-build-test-push-workflow.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,19 @@ jobs:
146146
ARM64: "true"
147147
GRAVITON_TESTING: "true"
148148
steps:
149-
- name: Set Test Cluster Name
150-
run: |
151-
echo "TEST_CLUSTER_NAME=eks-test-cluster-smoke-arm-Ubuntu-${{ matrix.test }}-$GITHUB_RUN_ID" >> $GITHUB_ENV
152149
- name: Chekcout code
153150
uses: actions/checkout@v2
151+
- name: Set Test Cluster Name
152+
id: set-cluster-name
153+
uses: ./.github/actions/set-cluster-name
154+
with:
155+
test-type: smoke
156+
platform: arm-ubuntu
157+
test-name: ${{ matrix.test }}
158+
run-id: ${{ github.run_id }}
159+
- name: Export cluster name to environment
160+
run: |
161+
echo "TEST_CLUSTER_NAME=${{ steps.set-cluster-name.outputs.cluster-name }}" >> $GITHUB_ENV
154162
- name: Dotenv Action
155163
id: dotenv
156164
uses: falti/dotenv-action@d4d12eaa0e1dd06d5bdc3d7af3bf4c8c93cb5359

.github/workflows/arm-Ubuntu-int-test-workflow.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,6 @@ jobs:
9494
ARM64: "true"
9595
GRAVITON_TESTING: "true"
9696
steps:
97-
- name: Set Test Cluster Name
98-
run: |
99-
echo "TEST_CLUSTER_NAME=eks-test-cluster-integration-arm-Ubuntu-${{ matrix.test }}-$GITHUB_RUN_ID" >> $GITHUB_ENV
10097
- name: Set Test Cluster Nodes and Parallel Runs
10198
run: >-
10299
if grep -q "appframework" <<< "${{ matrix.test }}"; then
@@ -105,6 +102,17 @@ jobs:
105102
fi
106103
- name: Checkcout code
107104
uses: actions/checkout@v2
105+
- name: Set Test Cluster Name
106+
id: set-cluster-name
107+
uses: ./.github/actions/set-cluster-name
108+
with:
109+
test-type: integration
110+
platform: arm-ubuntu
111+
test-name: ${{ matrix.test }}
112+
run-id: ${{ github.run_id }}
113+
- name: Export cluster name to environment
114+
run: |
115+
echo "TEST_CLUSTER_NAME=${{ steps.set-cluster-name.outputs.cluster-name }}" >> $GITHUB_ENV
108116
- name: Dotenv Action
109117
id: dotenv
110118
uses: falti/dotenv-action@d4d12eaa0e1dd06d5bdc3d7af3bf4c8c93cb5359

.github/workflows/build-test-push-workflow.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,18 @@ jobs:
190190
CLUSTER_WIDE: "true"
191191
DEPLOYMENT_TYPE: ""
192192
steps:
193-
- name: Set Test Cluster Name
194-
run: |
195-
echo "TEST_CLUSTER_NAME=eks-test-cluster-smoke-${{ matrix.test }}-$GITHUB_RUN_ID" >> $GITHUB_ENV
196193
- name: Chekcout code
197194
uses: actions/checkout@v2
195+
- name: Set Test Cluster Name
196+
id: set-cluster-name
197+
uses: ./.github/actions/set-cluster-name
198+
with:
199+
test-type: smoke
200+
test-name: ${{ matrix.test }}
201+
run-id: ${{ github.run_id }}
202+
- name: Export cluster name to environment
203+
run: |
204+
echo "TEST_CLUSTER_NAME=${{ steps.set-cluster-name.outputs.cluster-name }}" >> $GITHUB_ENV
198205
- name: Dotenv Action
199206
id: dotenv
200207
uses: falti/dotenv-action@d4d12eaa0e1dd06d5bdc3d7af3bf4c8c93cb5359

.github/workflows/distroless-build-test-push-workflow.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,19 @@ jobs:
191191
CLUSTER_WIDE: "true"
192192
DEPLOYMENT_TYPE: ""
193193
steps:
194-
- name: Set Test Cluster Name
195-
run: |
196-
echo "TEST_CLUSTER_NAME=eks-test-cluster-smoke-distroless-${{ matrix.test }}-$GITHUB_RUN_ID" >> $GITHUB_ENV
197194
- name: Chekcout code
198195
uses: actions/checkout@v2
196+
- name: Set Test Cluster Name
197+
id: set-cluster-name
198+
uses: ./.github/actions/set-cluster-name
199+
with:
200+
test-type: smoke
201+
platform: distroless
202+
test-name: ${{ matrix.test }}
203+
run-id: ${{ github.run_id }}
204+
- name: Export cluster name to environment
205+
run: |
206+
echo "TEST_CLUSTER_NAME=${{ steps.set-cluster-name.outputs.cluster-name }}" >> $GITHUB_ENV
199207
- name: Dotenv Action
200208
id: dotenv
201209
uses: falti/dotenv-action@d4d12eaa0e1dd06d5bdc3d7af3bf4c8c93cb5359

.github/workflows/distroless-int-test-workflow.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,6 @@ jobs:
8888
CLUSTER_WIDE: "true"
8989
DEPLOYMENT_TYPE: ""
9090
steps:
91-
- name: Set Test Cluster Name
92-
run: |
93-
echo "TEST_CLUSTER_NAME=eks-test-cluster-integration-distroless-${{ matrix.test }}-$GITHUB_RUN_ID" >> $GITHUB_ENV
9491
- name: Set Test Cluster Nodes and Parallel Runs
9592
run: >-
9693
if grep -q "appframework" <<< "${{ matrix.test }}"; then
@@ -99,6 +96,17 @@ jobs:
9996
fi
10097
- name: Checkcout code
10198
uses: actions/checkout@v2
99+
- name: Set Test Cluster Name
100+
id: set-cluster-name
101+
uses: ./.github/actions/set-cluster-name
102+
with:
103+
test-type: integration
104+
platform: distroless
105+
test-name: ${{ matrix.test }}
106+
run-id: ${{ github.run_id }}
107+
- name: Export cluster name to environment
108+
run: |
109+
echo "TEST_CLUSTER_NAME=${{ steps.set-cluster-name.outputs.cluster-name }}" >> $GITHUB_ENV
102110
- name: Dotenv Action
103111
id: dotenv
104112
uses: falti/dotenv-action@d4d12eaa0e1dd06d5bdc3d7af3bf4c8c93cb5359

0 commit comments

Comments
 (0)