From ce648cb65fb0bfa03f61ed1f8e58899d72045c7a Mon Sep 17 00:00:00 2001 From: continuist Date: Sat, 13 Sep 2025 14:31:27 -0400 Subject: [PATCH] test --- .forgejo/workflows/ci.yml | 42 +++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 8aa260d..092e4c2 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -11,7 +11,9 @@ env: APP_NAME: ${{ secrets.APP_NAME }} IMAGE_TAG: ${{ github.sha }} RUN_ID: ${{ github.run_id }} - # Your other env vars... + RUST_IMG_DIGEST: ${{ secrets.RUST_IMG_DIGEST }} + NODE_IMG_DIGEST: ${{ secrets.NODE_IMG_DIGEST }} + POSTGRES_IMG_DIGEST: ${{ secrets.POSTGRES_IMG_DIGEST }} jobs: test-backend: @@ -20,34 +22,29 @@ jobs: image: git.gcdo.org/devteam/sharenet/ci-node-podman@sha256:eb0d942bd9a8cc69c63eb9ccf3877703898d676d0268cf379defdcda7e55f37f steps: - uses: actions/checkout@v4 - - - name: Debug environment - run: | - echo "Current user: $(id)" - echo "DOCKER_HOST: $DOCKER_HOST" - ls -la /run/ || echo "No /run directory" - which podman || echo "Podman not found" - podman --version || echo "Podman command failed" - - name: Test Podman access + - name: Verify podman socket run: | - # Test using the Docker CLI with the socket - podman info || echo "podman info failed" - podman ps || echo "podman ps failed" + echo "DOCKER_HOST=$DOCKER_HOST" + test -S /tmp/podman.sock || { echo "missing /tmp/podman.sock"; exit 1; } + mkdir -p "${XDG_CONFIG_HOME:-/tmp/.config}/containers" + # Prefer explicit remote; fallback to podman-remote if that's what's installed + (podman --remote info || podman-remote info) | sed -n '1,80p' - name: Verify pinned digests run: | + set -euo pipefail for v in RUST_IMG_DIGEST NODE_IMG_DIGEST POSTGRES_IMG_DIGEST; do [ -n "${!v}" ] || { echo "Missing $v"; exit 1; } echo "${!v}" | grep -Eq '^.+@sha256:[0-9a-f]{64}$' || { echo "$v must be a digest ref"; exit 1; } done - name: Create internal network - run: docker network create --internal integ-${{ env.RUN_ID }} + run: podman --remote network create --internal integ-${{ env.RUN_ID }} - name: Start PostgreSQL run: | - docker run -d \ + podman --remote run -d \ --name test-postgres-${{ env.RUN_ID }} \ --network integ-${{ env.RUN_ID }} \ -e POSTGRES_PASSWORD=password \ @@ -57,24 +54,25 @@ jobs: - name: Wait for PostgreSQL run: | - timeout 60 bash -c ' - until docker exec test-postgres-${{ env.RUN_ID }} pg_isready -h 127.0.0.1 -p 5432 -U postgres; do + timeout 60 bash -euc ' + until podman --remote exec test-postgres-${{ env.RUN_ID }} \ + pg_isready -h 127.0.0.1 -p 5432 -U postgres; do sleep 1 done ' - + - name: Run backend tests run: | - docker run --rm \ + podman --remote run --rm \ -v "$PWD":/workspace \ -w /workspace \ --network integ-${{ env.RUN_ID }} \ -e DATABASE_URL=postgres://postgres:password@test-postgres-${{ env.RUN_ID }}:5432/sharenet_test \ "$RUST_IMG_DIGEST" \ - sh -c "cargo test --lib -- --test-threads=1" + sh -lc 'cargo test --lib -- --test-threads=1' - name: Cleanup if: always() run: | - docker rm -f test-postgres-${{ env.RUN_ID }} 2>/dev/null || true - docker network rm integ-${{ env.RUN_ID }} 2>/dev/null || true \ No newline at end of file + 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