3 Commits

Author SHA1 Message Date
me 9a415a964c chore: rename postgres service to test-db in CI workflow
CI / Generate Certificates (pull_request) Successful in 51s
ci.yml / Backend CI (pull_request) Has been cancelled
CI / E2E Tests (pull_request) Has been cancelled
CI / Frontend CI (pull_request) Has been cancelled
2026-05-05 18:57:55 +05:30
me 601dbd5c9b chore: remove PGDATA configuration from CI workflow
CI / Generate Certificates (pull_request) Successful in 29s
CI / Frontend CI (pull_request) Successful in 1m7s
CI / E2E Tests (pull_request) Successful in 6m33s
ci.yml / Backend CI (pull_request) Has been cancelled
2026-05-05 18:39:17 +05:30
me d2d8c88f69 fix: add internal host routing for Gitea Actions environment in e2e
CI / Generate Certificates (pull_request) Successful in 29s
CI / Frontend CI (pull_request) Successful in 1m10s
CI / E2E Tests (pull_request) Successful in 6m36s
ci.yml / Backend CI (pull_request) Has been cancelled
2026-05-05 18:30:06 +05:30
2 changed files with 16 additions and 6 deletions
+3 -6
View File
@@ -31,18 +31,15 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: setup-environment needs: setup-environment
services: services:
postgres: test-db:
image: postgres:16-alpine image: postgres:16-alpine
env: env:
POSTGRES_DB: piku_test POSTGRES_DB: piku_test
POSTGRES_USER: test POSTGRES_USER: test
POSTGRES_PASSWORD: password123 POSTGRES_PASSWORD: password123
# WHY?: gitea act runner seems to persist volumes (veryyy stubborn -_-)
# Redirecting PGDATA to /tmp ensures a fresh init every run.
PGDATA: /tmp/pgdata
ports: ports:
- 5442:5432 - 5442:5432
options: --tmpfs /var/lib/postgresql/data --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
defaults: defaults:
run: run:
working-directory: ./backend working-directory: ./backend
@@ -65,7 +62,7 @@ jobs:
cp ../.env.example ../.env cp ../.env.example ../.env
uv sync uv sync
if [ "$GITEA_ACTIONS" = "true" ]; then if [ "$GITEA_ACTIONS" = "true" ]; then
export DB_HOST="postgres" export DB_HOST="test-db"
export DB_PORT="5432" export DB_PORT="5432"
else else
export DB_HOST="127.0.0.1" export DB_HOST="127.0.0.1"
+13
View File
@@ -55,6 +55,19 @@ until $CONTAINER_BIN exec "$DB_NAME" pg_isready -U "${DB_USER:-test}" >/dev/null
done done
export PIKU_ENV_FILE="$ENV_FILE" export PIKU_ENV_FILE="$ENV_FILE"
# NOTE: When running in Gitea Actions (within container), 127.0.0.1 is the actions instance.
# We must route DB and mail traffic to the docker host instead.
if [ "$GITEA_ACTIONS" = "true" ]; then
sudo apt-get update && sudo apt-get install -y iproute2
# Sample: "default via <internal docker host IP> dev <network interface> proto dhcp src <IP> metric 100"
HOST_IP=$(ip route show default | awk '/default/ {print $3}')
echo "Running on Gitea. Internal Docker host... $HOST_IP"
export DB_HOST=$HOST_IP
export EMAIL_HOST=$HOST_IP
fi
echo "Starting Backend..." echo "Starting Backend..."
mkdir -p ./tmp/logs mkdir -p ./tmp/logs
( (