poc
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 17s

This commit is contained in:
moilanik
2026-06-13 07:19:59 +03:00
parent 525f091d91
commit 93c5460fd4
2 changed files with 34 additions and 2 deletions
+4 -2
View File
@@ -31,12 +31,14 @@ jobs:
id: bats-tests
shell: bash
run: |
CID=$(docker run -d --entrypoint tail ${{ inputs.bats-image }} -f /dev/null)
docker cp . $CID:/workspace
mkdir -p "reports/${GITHUB_SHA:0:8}/bats"
set +e
docker run --rm -v "$PWD:/code" --entrypoint bash ${{ inputs.bats-image }} \
-c 'bats /code/tests/' \
docker exec $CID bash -c 'cd /workspace && bats tests/' \
> "reports/${GITHUB_SHA:0:8}/bats/results.txt" 2>&1
BATS_EXIT=$?
docker rm -f $CID > /dev/null 2>&1
{
echo "<html><body><h1>Bats tests</h1><ul>"
for f in reports/${GITHUB_SHA:0:8}/bats/*; do
+30
View File
@@ -0,0 +1,30 @@
name: POC Docker volume mount
on:
push:
branches:
- plan/0003-alkaa-käyttämään-itseään-commit-raportti
jobs:
test-volume:
runs-on: ubuntu-latest
steps:
- name: Create shared volume
run: docker volume create poc-shared
- name: Container 1 — write file
run: |
docker run --rm -v poc-shared:/data alpine sh -c '
echo "Hello from container 1! Timestamp: $(date -u)" > /data/hello.txt
echo "Container 1 wrote file. Content:"
cat /data/hello.txt
'
- name: Container 2 — read file
run: |
docker run --rm -v poc-shared:/data alpine sh -c '
echo "Container 2 reads:"
cat /data/hello.txt
'
- name: Cleanup
run: docker volume rm poc-shared