CI:用 docker cp 替代 -v 挂载(runner 容器内工作区路径不是宿主机路径)
build-test-deploy / ci (push) Failing after 5m13s

This commit is contained in:
zjk
2026-08-14 15:27:17 +08:00
parent 52bce119bd
commit 6d765ee165
+16 -3
View File
@@ -70,13 +70,26 @@ jobs:
#------------------------------------------------------------------- #-------------------------------------------------------------------
# Build project + unit test + startup smoke test (inside arm64) # Build project + unit test + startup smoke test (inside arm64)
# NOTE: the runner runs inside a container, so the workspace path is
# not a host path -> `-v` mounts don't work. Use `docker cp`
# (streams files through the docker socket) instead.
#------------------------------------------------------------------- #-------------------------------------------------------------------
- name: Build & test inside arm64 container - name: Build & test inside arm64 container
timeout-minutes: 30 timeout-minutes: 30
run: | run: |
docker run --rm \ set -euo pipefail
-v "$GITHUB_WORKSPACE:/src" \ CID="h100-ci-test"
"$CI_IMAGE" /src/ci/build-test.sh docker rm -f "$CID" >/dev/null 2>&1 || true
docker create --name "$CID" --platform linux/arm64 "$CI_IMAGE" /bin/sh -c 'sleep 7200' >/dev/null
docker cp "$PWD/." "$CID:/src/"
docker start "$CID" >/dev/null
docker exec "$CID" /src/ci/build-test.sh
mkdir -p bin
docker cp "$CID:/src/bin/pPowerManger" bin/pPowerManger
docker cp "$CID:/src/bin/pPMtest" bin/pPMtest
docker cp "$CID:/src/bin/SQLiteTest" bin/SQLiteTest
docker rm -f "$CID" >/dev/null 2>&1 || true
ls -la bin/
#------------------------------------------------------------------- #-------------------------------------------------------------------
# Deploy the cross-built binary to the RK3588 board (push only) # Deploy the cross-built binary to the RK3588 board (push only)