1
0
Fork 0
mirror of https://github.com/imjasonh/krust synced 2026-07-12 16:39:07 +00:00

Improve platform detection and add multi-arch run test

- Updated get_test_platform() to detect runtime architecture in CI
  - CI tests use native platform (linux/amd64 on x86_64, linux/arm64 on aarch64)
  - Local development always uses linux/amd64 for consistency

- Added test_multi_arch_build_and_run() test
  - Builds multi-arch image and pushes to ttl.sh
  - Verifies the image runs correctly on the current architecture
  - Gracefully handles missing toolchain scenarios

- Updated CI integration test to verify multi-arch images can run
  - Builds for both linux/amd64 and linux/arm64
  - Runs the image to ensure Docker selects the correct architecture

This ensures we properly test both single and multi-arch scenarios.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Jason Hall 2025-06-07 22:58:06 -04:00
parent 90c871f24d
commit 068ad65477
Failed to extract signature
2 changed files with 78 additions and 5 deletions

View file

@ -162,10 +162,15 @@ jobs:
run: |
cd example/hello-krust
krust build --no-push --image local.test/hello:latest ./
- name: Test multi-arch build
- name: Test multi-arch build and run
run: |
cd example/hello-krust
krust build --no-push --platform linux/amd64,linux/arm64 --image local.test/multiarch:latest ./
# Build for both platforms and push
export KRUST_REPO=ttl.sh/${{ github.run_id }}-multiarch
IMAGE_REF=$(krust build --platform linux/amd64,linux/arm64 ./)
echo "Built multi-arch image: $IMAGE_REF"
# Run the image - should automatically select the right architecture
docker run --rm $IMAGE_REF
# Takes too long to run on CI, so it's commented out for now.
# coverage: