ci: 验证 workspace 自动检出与 docker build
CI Test / test (push) Successful in 17s

This commit is contained in:
2026-08-31 14:31:47 +08:00
parent 5d47765010
commit 238ace05dc
+11 -3
View File
@@ -5,15 +5,23 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: container:
image: docker:24.0-cli image: docker:24.0-cli
options: -v /opt/freedom:/opt/freedom options: -v /opt/freedom:/opt/freedom --add-host=host.docker.internal:host-gateway
steps: steps:
- name: Verify - name: Verify
run: | run: |
echo "=== pwd & 工作目录 ==="
pwd; ls -la
echo "=== workspace 是否被自动检出 ==="
ls -la /workspace/yiciheng/ci-test 2>&1
echo "=== /opt/freedom ===" echo "=== /opt/freedom ==="
ls -la /opt/freedom ls -la /opt/freedom
echo "=== sock ===" echo "=== sock ==="
test -S /var/run/docker.sock && echo SOCK_OK || echo SOCK_NO test -S /var/run/docker.sock && echo SOCK_OK || echo SOCK_NO
echo "=== write test ===" echo "=== host.docker.internal 解析 ==="
echo hello > /opt/freedom/.ci_write_test && cat /opt/freedom/.ci_write_test && rm /opt/freedom/.ci_write_test && echo WRITE_OK getent hosts host.docker.internal || echo NOT_RESOLVED
wget -q -T 3 -O /dev/null http://host.docker.internal:3000/api/v1/version && echo GITEA_OK || echo GITEA_FAIL
echo "=== docker build 冒烟(容器内路径 -> 宿主 daemon)==="
mkdir -p /tmp/bt && printf 'FROM alpine:3\nRUN echo build-ok\n' > /tmp/bt/Dockerfile
docker build -t ci-smoke:latest /tmp/bt
echo "=== compose services ===" echo "=== compose services ==="
cd /opt/freedom/deploy && docker compose config --services cd /opt/freedom/deploy && docker compose config --services