test on ci.yml #2
Some checks failed
Podman Rootless Demo / test-backend (push) Failing after 39s
Podman Rootless Demo / test-rootless (push) Failing after 18s

This commit is contained in:
continuist 2025-09-18 22:41:47 -04:00
parent 3e23338255
commit be96f69f55

View file

@ -57,18 +57,36 @@ jobs:
done
'
- name: Run backend tests
- name: Ensure host Cargo cache directory exists
run: |
podman --remote run --rm \
-v "$PWD":/workspace \
-w /workspace \
-v /home/ci-service/.cache:/c \
alpine:3.20 sh -lc 'mkdir -p /c/cargo'
- name: Run backend tests (tar-pipe, no bind mount of source)
run: |
set -euo pipefail
set -o pipefail
tar --exclude .git --exclude target -C "$GITHUB_WORKSPACE" -cf - . | \
podman --remote run --rm -i \
--network integ-${{ env.RUN_ID }} \
-e CARGO_HOME=/cargo \
-e DATABASE_URL=postgres://postgres:password@test-postgres-${{ env.RUN_ID }}:5432/sharenet_test \
-v /home/ci-service/.cache/cargo:/cargo \
"$RUST_IMG_DIGEST" \
sh -lc 'cargo test --lib -- --test-threads=1'
sh -euxc '
mkdir -p /workspace
tar -x -C /workspace
cd /workspace
cargo test --lib -- --test-threads=1
'
- name: Cleanup
if: always()
run: |
podman --remote rm -f test-postgres-${{ env.RUN_ID }} 2>/dev/null || true
podman --remote network rm integ-${{ env.RUN_ID }} 2>/dev/null || true
podman --remote network rm integ-${{ env.RUN_ID }} 2>/dev/null || true
- name: Debug DB (on failure)
if: failure()
run: podman --remote logs --tail=200 test-postgres-${{ env.RUN_ID }} || true