diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 61e0e38..7b4c72c 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -97,8 +97,32 @@ jobs: DATABASE_URL: ${{ secrets.DATABASE_URL }} timeout-minutes: 5 - - name: Worker Integration tests + - name: Check if Worker paths changed run: | + cd $WORKDIR + PREV=$(cat /tmp/prev-head 2>/dev/null || echo "") + if [ -n "$PREV" ]; then + CHANGED=$(git diff --name-only $PREV..HEAD 2>/dev/null || echo "") + else + CHANGED=$(git diff --name-only HEAD~1..HEAD 2>/dev/null || echo "") + fi + echo "Changed files: $CHANGED" + if echo "$CHANGED" | grep -qE "src/workers/|src/modules/ai-analysis/|src/modules/ai/|src/infrastructure/queue/|src/infrastructure/outbox/|prisma/schema.prisma|prisma/migrations/|test/worker-integration|test/run-integration"; then + echo "Worker-related changes detected — running integration tests" + echo "run_int=true" > /tmp/int-decision + else + echo "No Worker-related changes — skipping integration tests" + echo "run_int=false" > /tmp/int-decision + fi + + - name: Worker Integration tests + if: success() + run: | + RUN=$(cat /tmp/int-decision 2>/dev/null | grep -o 'true\|false' || echo "false") + if [ "$RUN" != "true" ]; then + echo "[integration] Skipped — no Worker-related changes" + exit 0 + fi cd $WORKDIR bash test/run-integration-tests.sh env: