test on ci.yml #2
This commit is contained in:
parent
3e23338255
commit
be96f69f55
1 changed files with 23 additions and 5 deletions
|
@ -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
|
||||
|
||||
- name: Debug DB (on failure)
|
||||
if: failure()
|
||||
run: podman --remote logs --tail=200 test-postgres-${{ env.RUN_ID }} || true
|
Loading…
Add table
Reference in a new issue