bats: volume-pohjainen workspace (docker volume + tar pipe)
ci-bats Bats tests FAILED
ci-cucumber Cucumber tests passed
CI / feature (push) Failing after 1m14s
CI / main (push) Has been skipped
POC Docker volume mount / test-volume (push) Successful in 11s

This commit is contained in:
moilanik
2026-06-13 07:25:08 +03:00
parent 93c5460fd4
commit 638798f59a
+4 -4
View File
@@ -31,14 +31,14 @@ jobs:
id: bats-tests id: bats-tests
shell: bash shell: bash
run: | run: |
CID=$(docker run -d --entrypoint tail ${{ inputs.bats-image }} -f /dev/null) docker volume create bats-workspace
docker cp . $CID:/workspace tar c . | docker run --rm -i -v bats-workspace:/data alpine tar x -C /data
mkdir -p "reports/${GITHUB_SHA:0:8}/bats" mkdir -p "reports/${GITHUB_SHA:0:8}/bats"
set +e set +e
docker exec $CID bash -c 'cd /workspace && bats tests/' \ docker run --rm -v bats-workspace:/data --workdir /data ${{ inputs.bats-image }} tests/ \
> "reports/${GITHUB_SHA:0:8}/bats/results.txt" 2>&1 > "reports/${GITHUB_SHA:0:8}/bats/results.txt" 2>&1
BATS_EXIT=$? BATS_EXIT=$?
docker rm -f $CID > /dev/null 2>&1 docker volume rm bats-workspace > /dev/null 2>&1
{ {
echo "<html><body><h1>Bats tests</h1><ul>" echo "<html><body><h1>Bats tests</h1><ul>"
for f in reports/${GITHUB_SHA:0:8}/bats/*; do for f in reports/${GITHUB_SHA:0:8}/bats/*; do