11name : Test OpenEBS on Arm64
22
33on :
4+ workflow_dispatch :
45 workflow_call :
56 push :
67 branches :
78 - main
89 - smoke_tests
910 paths :
1011 - ' content/opensource_packages/openebs.md'
11- - ' .github/workflows/test-OpenEBS .yml'
12+ - ' .github/workflows/test-openebs .yml'
1213
1314jobs :
1415 test-openebs :
1516 runs-on : ubuntu-24.04-arm
16-
1717 steps :
1818 - name : Checkout repository
1919 uses : actions/checkout@v4
20-
20+
2121 - name : Set test metadata
2222 id : metadata
2323 run : |
2424 echo "timestamp=$(date -u +%Y-%m-%dT%H:%M:%SZ)" >> $GITHUB_OUTPUT
25- echo "package_slug=OpenEBS " >> $GITHUB_OUTPUT
26- echo "dashboard_link=/opensource_packages/OpenEBS " >> $GITHUB_OUTPUT
27-
28- - name : Install OpenEBS (Helm/CLI )
25+ echo "package_slug=openebs " >> $GITHUB_OUTPUT
26+ echo "dashboard_link=/opensource_packages/openebs " >> $GITHUB_OUTPUT
27+
28+ - name : Install OpenEBS (Verification )
2929 id : install
3030 run : |
31- echo "Checking OpenEBS availability..."
32-
33- # OpenEBS is a K8s storage solution.
34- # We check if the Helm chart is available and if we can fetch it.
35- # We also try to install the kubectl-openebs plugin if available, but primarily check helm.
36-
37- # Install Helm using script (avoid snap in CI)
31+ echo "Verifying OpenEBS availability..."
3832 curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
39-
40- # Add OpenEBS repo
4133 helm repo add openebs https://openebs.github.io/charts
4234 helm repo update
4335
44- # Verify availability
4536 if helm search repo openebs/openebs; then
46- echo "OpenEBS helm chart found"
37+ echo "OpenEBS found"
4738 echo "install_status=success" >> $GITHUB_OUTPUT
4839 else
49- echo "OpenEBS helm chart not found"
40+ echo "OpenEBS not found"
5041 echo "install_status=failed" >> $GITHUB_OUTPUT
5142 exit 1
5243 fi
53-
44+
5445 - name : Get OpenEBS version
5546 id : version
5647 run : |
57- # Get version from helm chart
5848 VERSION=$(helm search repo openebs/openebs | grep openebs/openebs | awk '{print $2}' | head -1)
5949 echo "version=$VERSION" >> $GITHUB_OUTPUT
6050 echo "Detected OpenEBS chart version: $VERSION"
61-
62- - name : Test 1 - Check Helm Repo
51+
52+ - name : Test 1 - Helm Template Verification
6353 id : test1
6454 continue-on-error : true
6555 run : |
6656 START_TIME=$(date +%s)
67-
68- if helm repo list | grep -q openebs; then
69- echo "✓ OpenEBS helm repo added"
70- echo "status=passed" >> $GITHUB_OUTPUT
71- else
72- echo "✗ OpenEBS helm repo not found"
73- echo "status=failed" >> $GITHUB_OUTPUT
74- exit 1
75- fi
76-
77- END_TIME=$(date +%s)
78- echo "duration=$((END_TIME - START_TIME))" >> $GITHUB_OUTPUT
79-
80- - name : Test 2 - Search for OpenEBS components
81- id : test2
82- continue-on-error : true
83- run : |
84- START_TIME=$(date +%s)
85-
86- if helm search repo openebs | grep -q "Containerized Storage for CI/CD"; then
87- echo "✓ OpenEBS components found"
57+ if helm template openebs openebs/openebs > /dev/null; then
58+ echo "✓ Helm template passed"
8859 echo "status=passed" >> $GITHUB_OUTPUT
8960 else
90- echo "✗ OpenEBS components not found "
61+ echo "✗ Helm template failed "
9162 echo "status=failed" >> $GITHUB_OUTPUT
9263 exit 1
93- fi
94-
95- END_TIME=$(date +%s)
96- echo "duration=$((END_TIME - START_TIME))" >> $GITHUB_OUTPUT
97-
98- - name : Test 3 - Check for Mayastor (Optional)
99- id : test3
100- continue-on-error : true
101- run : |
102- START_TIME=$(date +%s)
103-
104- # OpenEBS Mayastor is a key component
105- # It might be in a separate repo or part of openebs
106- # We just log it
107- if helm search repo openebs | grep -i mayastor; then
108- echo "✓ Mayastor found in charts"
109- echo "status=passed" >> $GITHUB_OUTPUT
110- else
111- echo "⚠ Mayastor not explicitly found (might be bundled or in different repo), passing"
112- echo "status=passed" >> $GITHUB_OUTPUT
11364 fi
114-
11565 END_TIME=$(date +%s)
11666 echo "duration=$((END_TIME - START_TIME))" >> $GITHUB_OUTPUT
117-
118- - name : Test 4 - Architecture Verification
119- id : test4
67+
68+ - name : Test 2 - Architecture Verification
69+ id : test2
12070 continue-on-error : true
12171 run : |
12272 START_TIME=$(date +%s)
123-
124- echo "Checking system architecture..."
12573 ARCH=$(uname -m)
12674 if [ "$ARCH" = "aarch64" ]; then
127- echo "✓ System architecture is ARM64 ($ARCH) "
75+ echo "✓ System architecture is ARM64"
12876 echo "status=passed" >> $GITHUB_OUTPUT
12977 else
13078 echo "✗ System architecture is NOT ARM64 ($ARCH)"
13179 echo "status=failed" >> $GITHUB_OUTPUT
13280 exit 1
13381 fi
134-
13582 END_TIME=$(date +%s)
13683 echo "duration=$((END_TIME - START_TIME))" >> $GITHUB_OUTPUT
137-
138- - name : Test 5 - Functional Validation (Helm Dry Run)
139- id : test5
140- continue-on-error : true
141- run : |
142- START_TIME=$(date +%s)
143- # Try to template the chart to verify it works on this arch (at least templating)
144- if helm template openebs openebs/openebs > /dev/null; then
145- echo "✓ Helm template verification passed"
146- echo "status=passed" >> $GITHUB_OUTPUT
147- else
148- echo "✗ Helm template verification failed"
149- echo "status=failed" >> $GITHUB_OUTPUT
150- exit 1
151- fi
15284
153- END_TIME=$(date +%s)
154- echo "duration=$((END_TIME - START_TIME))" >> $GITHUB_OUTPUT
15585 - name : Calculate test summary
15686 if : always()
15787 id : summary
15888 run : |
15989 PASSED=0
16090 FAILED=0
16191 TOTAL_DURATION=0
162-
163- # Check Helm Repo
164- if [ "${{ steps.test1.outputs.status }}" == "passed" ]; then
165- PASSED=$((PASSED + 1))
166- else
167- FAILED=$((FAILED + 1))
168- fi
169- TOTAL_DURATION=$((TOTAL_DURATION + ${{ steps.test1.outputs.duration || 0 }}))
170-
171- # Search for OpenEBS components
172- if [ "${{ steps.test2.outputs.status }}" == "passed" ]; then
173- PASSED=$((PASSED + 1))
174- else
175- FAILED=$((FAILED + 1))
176- fi
177- TOTAL_DURATION=$((TOTAL_DURATION + ${{ steps.test2.outputs.duration || 0 }}))
178-
179- # Check for Mayastor (Optional)
180- if [ "${{ steps.test3.outputs.status }}" == "passed" ]; then
181- PASSED=$((PASSED + 1))
182- else
183- FAILED=$((FAILED + 1))
184- fi
185- TOTAL_DURATION=$((TOTAL_DURATION + ${{ steps.test3.outputs.duration || 0 }}))
186-
187- # Architecture Verification
188- if [ "${{ steps.test4.outputs.status }}" == "passed" ]; then
189- PASSED=$((PASSED + 1))
190- else
191- FAILED=$((FAILED + 1))
192- fi
193- TOTAL_DURATION=$((TOTAL_DURATION + ${{ steps.test4.outputs.duration || 0 }}))
194-
195- # Functional Validation (Helm Dry Run)
196- if [ "${{ steps.test5.outputs.status }}" == "passed" ]; then
197- PASSED=$((PASSED + 1))
198- else
199- FAILED=$((FAILED + 1))
200- fi
201- TOTAL_DURATION=$((TOTAL_DURATION + ${{ steps.test5.outputs.duration || 0 }}))
202-
92+ for i in {1..2}; do
93+ eval STATUS=\$steps.test$i.outputs.status
94+ eval DURATION=\$steps.test$i.outputs.duration
95+ if [ "$STATUS" == "passed" ]; then
96+ PASSED=$((PASSED + 1))
97+ else
98+ FAILED=$((FAILED + 1))
99+ fi
100+ TOTAL_DURATION=$((TOTAL_DURATION + ${DURATION:-0}))
101+ done
203102 echo "passed=$PASSED" >> $GITHUB_OUTPUT
204103 echo "failed=$FAILED" >> $GITHUB_OUTPUT
205104 echo "duration=$TOTAL_DURATION" >> $GITHUB_OUTPUT
206-
207105 if [ $FAILED -eq 0 ]; then
208106 echo "overall_status=success" >> $GITHUB_OUTPUT
209- echo "badge_status=passing" >> $GITHUB_OUTPUT
210107 else
211108 echo "overall_status=failure" >> $GITHUB_OUTPUT
212- echo "badge_status=failing" >> $GITHUB_OUTPUT
213109 exit 1
214110 fi
111+
215112 - name : Generate test results JSON
216113 if : always()
217114 run : |
218115 mkdir -p test-results
219-
220- cat > test-results/OpenEBS.json << EOF
116+ cat > test-results/openebs.json << EOF
221117 {
222118 "schema_version": "1.0",
223119 "package": {
@@ -227,81 +123,21 @@ jobs:
227123 "category": "Storage"
228124 },
229125 "run": {
230- "id": "${{ github.run_id }}",
231- "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}?query=job:${{ github.job }}",
232- "timestamp": "${{ steps.metadata.outputs.timestamp }}",
233126 "status": "${{ steps.summary.outputs.overall_status }}",
234- "runner": {
235- "os": "ubuntu-24.04",
236- "arch": "arm64"
237- }
127+ "timestamp": "${{ steps.metadata.outputs.timestamp }}",
128+ "arch": "arm64"
238129 },
239130 "tests": {
240131 "passed": ${{ steps.summary.outputs.passed }},
241- "failed": ${{ steps.summary.outputs.failed }},
242- "skipped": 0,
243- "duration_seconds": ${{ steps.summary.outputs.duration || 0 }},
244- "details": [
245- {
246- "name": "Check Helm Repo",
247- "status": "${{ steps.test1.outputs.status || 'skipped' }}",
248- "duration_seconds": ${{ steps.test1.outputs.duration || 0 }}
249- },
250- {
251- "name": "Search for OpenEBS components",
252- "status": "${{ steps.test2.outputs.status || 'skipped' }}",
253- "duration_seconds": ${{ steps.test2.outputs.duration || 0 }}
254- },
255- {
256- "name": "Check for Mayastor (Optional)",
257- "status": "${{ steps.test3.outputs.status || 'skipped' }}",
258- "duration_seconds": ${{ steps.test3.outputs.duration || 0 }}
259- },
260- {
261- "name": "Architecture Verification",
262- "status": "${{ steps.test4.outputs.status || 'skipped' }}",
263- "duration_seconds": ${{ steps.test4.outputs.duration || 0 }}
264- },
265- {
266- "name": "Functional Validation (Helm Dry Run)",
267- "status": "${{ steps.test5.outputs.status || 'skipped' }}",
268- "duration_seconds": ${{ steps.test5.outputs.duration || 0 }}
269- }
270- ]
271- },
272- "metadata": {
273- "dashboard_link": "${{ steps.metadata.outputs.dashboard_link }}",
274- "badge_status": "${{ steps.summary.outputs.badge_status }}"
132+ "failed": ${{ steps.summary.outputs.failed }}
275133 }
276134 }
277135 EOF
278-
279- echo "Generated test results:"
280- cat test-results/OpenEBS.json
281-
136+
282137 - name : Upload test results
283138 if : always()
284139 uses : actions/upload-artifact@v4
285140 with :
286141 name : openebs-test-results
287- path : test-results/OpenEBS .json
142+ path : test-results/openebs .json
288143 retention-days : 90
289-
290- - name : Create test summary
291- if : always()
292- run : |
293- echo "## OpenEBS Test Results" >> $GITHUB_STEP_SUMMARY
294- echo "" >> $GITHUB_STEP_SUMMARY
295- echo "- **Version:** ${{ steps.version.outputs.version }}" >> $GITHUB_STEP_SUMMARY
296- echo "- **Status:** ${{ steps.summary.outputs.overall_status }}" >> $GITHUB_STEP_SUMMARY
297- echo "- **Tests Passed:** ${{ steps.summary.outputs.passed }}" >> $GITHUB_STEP_SUMMARY
298- echo "- **Tests Failed:** ${{ steps.summary.outputs.failed }}" >> $GITHUB_STEP_SUMMARY
299- echo "- **Duration:** ${{ steps.summary.outputs.duration || 0 }}s" >> $GITHUB_STEP_SUMMARY
300- echo "- **Runner:** ubuntu-24.04 (arm64)" >> $GITHUB_STEP_SUMMARY
301- echo "" >> $GITHUB_STEP_SUMMARY
302- echo "### Test Details" >> $GITHUB_STEP_SUMMARY
303- echo "1. Check Helm Repo: ${{ steps.test1.outputs.status || 'skipped' }}" >> $GITHUB_STEP_SUMMARY
304- echo "2. Search for OpenEBS components: ${{ steps.test2.outputs.status || 'skipped' }}" >> $GITHUB_STEP_SUMMARY
305- echo "3. Check for Mayastor: ${{ steps.test3.outputs.status || 'skipped' }}" >> $GITHUB_STEP_SUMMARY
306- echo "4. Test 4 - Architecture Verification: ${{ steps.test4.outputs.status || 'skipped' }}" >> $GITHUB_STEP_SUMMARY
307- echo "5. Test 5 - Functional Validation: ${{ steps.test5.outputs.status || 'skipped' }}" >> $GITHUB_STEP_SUMMARY
0 commit comments