Add multi-arch install test workflow - #21
Conversation
…ution - Fix tests/common.go to add .exe extension on Windows - Update workflow to run on install-test-workflow branch - Windows test only executes amd64 binary (native), verifies arm64 build - Fixes: ResourceUnavailable error trying to execute ARM64 on amd64 runner
- Matrix testing both amd64 and arm64 fails because GitHub windows-latest runners are amd64-only - ARM64 binaries cannot execute on amd64 runners (ResourceUnavailable error) - Fixed approach: Execute amd64 natively, verify arm64 build only - Use PowerShell syntax (.\) instead of bash syntax (./) for Windows - Add install-test-workflow branch trigger for testing This resolves: Program 'kubectl-oadp-windows-arm64.exe' failed to run: not a valid application for this OS platform
- Use windows-11-arm runner for native ARM64 Windows testing - Matrix testing now works with native runners for both architectures: - windows-latest (amd64) - windows-11-arm (arm64) - Both Windows binaries now get full native execution testing - Removes build-verification-only approach for ARM64 - Complete native testing coverage: 6/6 architectures tested natively This provides true cross-architecture validation instead of just build verification.
- Fix Linux ARM64 runner: ubuntu-latest-arm64 → ubuntu-24.04-arm (GitHub's ARM64 runners use -arm suffix, not -arm64) - Simplify workflow triggers to only main branch pushes and PRs - Remove test branch triggers (krew-init, install-test-workflow) This should resolve the Linux ARM64 job not starting (showing blank) and ensure workflow only runs for production branches.
| cp ${{ matrix.binary }} /tmp/bin/kubectl-oadp | ||
| chmod +x /tmp/bin/kubectl-oadp | ||
| export PATH="/tmp/bin:$PATH" | ||
|
|
There was a problem hiding this comment.
While GitHub Actions runs with set -e by default (which causes the script to exit on the first non-zero exit code), it would be better to make the error handling explicit here.
Currently, if any of these kubectl-oadp commands fail, the success message will not be printed due to the default behavior, but this isn't immediately obvious from reading the code.
Consider using one of these approaches for clarity:
Option 1 - Chain with &&:
echo "Testing kubectl plugin functionality on ${{ matrix.arch }}..." && \
kubectl-oadp --help && \
kubectl-oadp version --help && \
kubectl-oadp nonadmin --help && \
echo "✅ kubectl plugin tests passed on ${{ matrix.arch }}"Option 2 - Use if statement:
echo "Testing kubectl plugin functionality on ${{ matrix.arch }}..."
if kubectl-oadp --help && \
kubectl-oadp version --help && \
kubectl-oadp nonadmin --help; then
echo "✅ kubectl plugin tests passed on ${{ matrix.arch }}"
else
echo "❌ kubectl plugin tests failed on ${{ matrix.arch }}"
exit 1
fiThis makes the error handling explicit and ensures the success message only appears when all commands succeed.
There was a problem hiding this comment.
Explicit error handling added, ty!
| echo "Runner architecture: $(uname -m)" | ||
| echo "Go architecture: $(go env GOARCH)" | ||
|
|
||
| - name: Test binary execution |
There was a problem hiding this comment.
Same error handling concern as above. Consider making the error handling explicit with && chaining or an if statement.
- Add 'set -e' to all bash scripts for immediate exit on errors - Add '$ErrorActionPreference = "Stop"' to PowerShell scripts - Replace implicit error handling with explicit checks and clear error messages - Add file existence validation before attempting to use binaries - Use try-catch blocks in PowerShell for better error reporting - Add specific error messages with ❌ emoji for failed operations - Simplify summary logic with overall_success tracking variable - Ensure fail-fast behavior with descriptive failure reasons This makes debugging much easier when builds or tests fail across different architectures.
|
For future enhancement, you can https://github.com/docker/setup-qemu-action or podman equivalent and perform similar tests for ppc640le or s390x |
🏗️ Add Cross-Architecture Build & Test Workflow
📋 Overview
This PR introduces a comprehensive cross-architecture CI/CD pipeline that builds and tests the OADP CLI across 6 different architectures using GitHub's native runners. This ensures our kubectl plugin works correctly on all major platforms where users deploy it.
🎯 What This Adds
🔧 Multi-Architecture Build & Test Pipeline
🌍 Platform Coverage
amd64ubuntu-latestarm64ubuntu-24.04-armamd64macos-13(Intel)arm64macos-latest(Apple Silicon)amd64windows-latestarm64windows-11-arm🚀 Key Features
Build Phase
make release-buildto build all 6 architecturesTest Phase
kubectl oadpfunctionalityQuality Assurance
set -efor bash,$ErrorActionPreference = "Stop"for PowerShell🔧 Technical Improvements
Fixed Windows Testing
.exesuffixwindows-11-armrunner for true ARM64 validationEnhanced Test Infrastructure
GitHub Actions Optimization
📊 Workflow Structure
graph TD A[Build All Architectures] --> B[Linux Testing] A --> C[macOS Testing] A --> D[Windows Testing] B --> E[Test Summary] C --> E D --> EJobs:
build-all: Creates binaries for all 6 architectures using maketest-linux: Native testing on Ubuntu x64 & ARM64 runnerstest-macos: Native testing on Intel & Apple Silicon runnerstest-windows: Native testing on Windows x64 & ARM64 runnerstest-summary: Aggregates results and reports overall status🎉 Benefits
For Users
For Developers
For Releases
🧪 Testing
This workflow validates:
📈 Files Changed
+442lines: New comprehensive cross-architecture workflowtests/common.go: Windows .exe extension support.gitignore: Refined pattern for generated manifestsREADME.md: Added workflow status badge🏁 Result
This PR establishes gold-standard cross-architecture CI that ensures the OADP CLI works flawlessly across all major platforms where Kubernetes runs, providing confidence for both developers and users.
Ready for production-quality releases! 🚀