CI: use docker cp instead of bind mounts (sibling-container path trap)
CI / build-and-smoke (push) Successful in 5s

Under act_runner, inner 'docker run' hits the host daemon via the mounted
socket, so -v "$PWD/test:/work" mounts a nonexistent host path (empty).
Stream files in/out with docker cp instead. Same pattern will drive the
GlueXML release workflow.
This commit is contained in:
2026-06-25 22:48:49 -05:00
parent c615a5fb92
commit b659386bd2
+21 -11
View File
@@ -24,27 +24,37 @@ jobs:
- name: Build image - name: Build image
run: docker build -t mpq-packager:ci . run: docker build -t mpq-packager:ci .
# NOTE: act_runner runs these `docker` commands against the HOST daemon via
# the mounted socket, so bind-mounting the job's files (-v "$PWD:/work")
# doesn't work — the source path isn't on the host. Use `docker cp` to
# stream files in/out of a created container instead. The GlueXML release
# workflow uses this same pattern.
- name: Package the fixture - name: Package the fixture
run: | run: |
set -euo pipefail set -euo pipefail
docker run --rm \ cid=$(docker create \
-e INPUT_MANIFEST=mpq.yaml \ -e INPUT_MANIFEST=mpq.yaml \
-e INPUT_VERSION=v0.0.0-ci \ -e INPUT_VERSION=v0.0.0-ci \
-e INPUT_OUT_DIR=/work/dist \ -e INPUT_OUT_DIR=/work/dist \
-e GITHUB_WORKSPACE=/work \ -e GITHUB_WORKSPACE=/work \
-v "$PWD/test:/work" \ mpq-packager:ci)
mpq-packager:ci docker cp test/. "$cid:/work"
docker start -a "$cid"
docker cp "$cid:/work/dist/patch-Z.mpq" ./patch-Z.mpq
docker rm "$cid" >/dev/null
- name: Assert archive is valid and contains the expected file - name: Assert archive is valid and contains the expected file
run: | run: |
set -euo pipefail set -euo pipefail
test -s test/dist/patch-Z.mpq test -s patch-Z.mpq
echo "size: $(stat -c%s test/dist/patch-Z.mpq) bytes" echo "size: $(stat -c%s patch-Z.mpq) bytes"
# Read the archive back with StormLib (mpqpack --list/--cat). # Read the archive back with StormLib (mpqpack --list/--cat) inside a
docker run --rm --entrypoint mpqpack -v "$PWD/test:/work" mpq-packager:ci \ # sleeping container we exec into.
--list /work/dist/patch-Z.mpq | tee /tmp/list.txt cid=$(docker run -d --entrypoint sleep mpq-packager:ci 120)
grep -q 'Interface\\AddOns\\Fixture\\Hello.lua' /tmp/list.txt docker cp patch-Z.mpq "$cid:/patch-Z.mpq"
docker run --rm --entrypoint mpqpack -v "$PWD/test:/work" mpq-packager:ci \ docker exec "$cid" mpqpack --list /patch-Z.mpq | tee list.txt
--cat /work/dist/patch-Z.mpq 'Interface\AddOns\Fixture\Hello.lua' \ grep -q 'Interface\\AddOns\\Fixture\\Hello.lua' list.txt
docker exec "$cid" mpqpack --cat /patch-Z.mpq 'Interface\AddOns\Fixture\Hello.lua' \
| grep -q 'VERSION = "v0.0.0-ci"' | grep -q 'VERSION = "v0.0.0-ci"'
docker rm -f "$cid" >/dev/null
echo "OK: archive valid, path + substitution confirmed" echo "OK: archive valid, path + substitution confirmed"