🐛 fix(buildx_runner): verify multiarch with explicit platforms
This commit is contained in:
parent
ebd0f94053
commit
8445c6a363
|
|
@ -98,13 +98,13 @@ if [ "$ENABLE_BUILDX" = "true" ]; then
|
||||||
|
|
||||||
# 验证多架构支持
|
# 验证多架构支持
|
||||||
echo "Verifying multi-arch support..."
|
echo "Verifying multi-arch support..."
|
||||||
if docker run --rm arm64v8/alpine uname -m > /dev/null 2>&1; then
|
if docker run --rm --platform linux/arm64 alpine uname -m > /dev/null 2>&1; then
|
||||||
echo " ✓ arm64 support verified"
|
echo " ✓ arm64 support verified"
|
||||||
else
|
else
|
||||||
echo " ⚠ arm64 verification failed"
|
echo " ⚠ arm64 verification failed"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if docker run --rm amd64/alpine uname -m > /dev/null 2>&1; then
|
if docker run --rm --platform linux/amd64 alpine uname -m > /dev/null 2>&1; then
|
||||||
echo " ✓ amd64 support verified"
|
echo " ✓ amd64 support verified"
|
||||||
else
|
else
|
||||||
echo " ⚠ amd64 verification failed"
|
echo " ⚠ amd64 verification failed"
|
||||||
|
|
|
||||||
|
|
@ -199,6 +199,17 @@ test_stats_workflow_avoids_eval_find() {
|
||||||
grep -q 'LANG_FIND_ARGS=()' "${file}" || fail "stats workflow should build language-specific find arguments via arrays"
|
grep -q 'LANG_FIND_ARGS=()' "${file}" || fail "stats workflow should build language-specific find arguments via arrays"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test_entrypoint_uses_platform_aware_multiarch_verification() {
|
||||||
|
local file
|
||||||
|
|
||||||
|
file="${REPO_ROOT}/docker-runner/common/entrypoint.sh"
|
||||||
|
|
||||||
|
grep -q 'docker run --rm --platform linux/arm64 alpine uname -m' "${file}" || fail "entrypoint.sh should verify arm64 support with an explicit platform"
|
||||||
|
grep -q 'docker run --rm --platform linux/amd64 alpine uname -m' "${file}" || fail "entrypoint.sh should verify amd64 support with an explicit platform"
|
||||||
|
! rg -q 'docker run --rm arm64v8/alpine uname -m' "${file}" || fail "entrypoint.sh should not use arm64v8/alpine without an explicit platform"
|
||||||
|
! rg -q 'docker run --rm amd64/alpine uname -m' "${file}" || fail "entrypoint.sh should not use amd64/alpine without an explicit platform"
|
||||||
|
}
|
||||||
|
|
||||||
test_preset_compose_uses_env_for_instance
|
test_preset_compose_uses_env_for_instance
|
||||||
test_workflows_do_not_hardcode_company_server
|
test_workflows_do_not_hardcode_company_server
|
||||||
test_stats_workflow_uses_workflow_secret_consistently
|
test_stats_workflow_uses_workflow_secret_consistently
|
||||||
|
|
@ -215,5 +226,6 @@ test_register_requires_python_yaml_path
|
||||||
test_setup_requires_upgrade_helper
|
test_setup_requires_upgrade_helper
|
||||||
test_entrypoint_uses_shared_buildx_builder_creation
|
test_entrypoint_uses_shared_buildx_builder_creation
|
||||||
test_stats_workflow_avoids_eval_find
|
test_stats_workflow_avoids_eval_find
|
||||||
|
test_entrypoint_uses_platform_aware_multiarch_verification
|
||||||
|
|
||||||
echo "template_defaults_test.sh: PASS"
|
echo "template_defaults_test.sh: PASS"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue