From 2a2cca95375373daac957957b4aa6ad6d8ec9ae6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antoni=20Nu=C3=B1ez=20Romeu?= Date: Thu, 16 Jul 2026 18:30:46 +0200 Subject: [PATCH] =?UTF-8?q?fix(ci):=20fix=20test-branches.yaml=20=E2=80=94?= =?UTF-8?q?=20parapharmacy-api=20output=20missing,=20pip-platform=20wrong?= =?UTF-8?q?=20trigger/runtime?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add parapharmacy-api and pip-platform to detect-changes outputs (was defined in filter but never exposed) - Fix parapharmacy-api: correct workspace name, remove sqlite3/bcrypt rebuild, add MongoDB service - Fix pip-platform: trigger on pip-platform changes instead of backend, rewrite from Node.js to Python (uv + pytest) with PostgreSQL and Redis services --- .gitea/workflows/test-branches.yaml | 57 ++++++++++++++++++++++------- 1 file changed, 44 insertions(+), 13 deletions(-) diff --git a/.gitea/workflows/test-branches.yaml b/.gitea/workflows/test-branches.yaml index 164f167..44d11d4 100644 --- a/.gitea/workflows/test-branches.yaml +++ b/.gitea/workflows/test-branches.yaml @@ -13,6 +13,8 @@ jobs: backend: ${{ steps.filter.outputs.backend }} frontend: ${{ steps.filter.outputs.frontend }} frontend-mobile: ${{ steps.filter.outputs.frontend-mobile }} + parapharmacy-api: ${{ steps.filter.outputs.parapharmacy-api }} + pip-platform: ${{ steps.filter.outputs.pip-platform }} steps: - uses: actions/checkout@v4 - uses: dorny/paths-filter@v3 @@ -31,6 +33,8 @@ jobs: parapharmacy-api: - 'apps/parapharmacy-api/**' - 'packages/**' + pip-platform: + - 'apps/pip-platform/**' test-backend: name: Backend Tests @@ -95,6 +99,11 @@ jobs: if: needs.detect-changes.outputs.parapharmacy-api == 'true' runs-on: ubuntu-latest timeout-minutes: 15 + services: + mongodb: + image: mongo:7 + ports: + - 27017:27017 steps: - uses: actions/checkout@v4 - name: Setup Node.js @@ -104,27 +113,49 @@ jobs: cache: 'npm' - name: Install dependencies run: npm ci --ignore-scripts - - name: Install parapharmacy-api native deps - run: npm rebuild sqlite3 bcrypt --workspace=farma-clic-parapharmacy-api - name: Run Parapharmacy API Tests - run: npm test --workspace=farma-clic-parapharmacy-api + run: npm test --workspace=farmafinder-parapharmacy-api test-pip-platform: name: PIP Platform Tests needs: detect-changes - if: needs.detect-changes.outputs.backend == 'true' + if: needs.detect-changes.outputs.pip-platform == 'true' runs-on: ubuntu-latest timeout-minutes: 15 + services: + postgres: + image: postgres:16-alpine + env: + POSTGRES_DB: pip_test + POSTGRES_USER: pip + POSTGRES_PASSWORD: pip_test + ports: + - 5432:5432 + options: >- + --health-cmd="pg_isready -U pip" + --health-interval=10s + --health-timeout=5s + --health-retries=5 + redis: + image: redis:alpine + ports: + - 6379:6379 + options: >- + --health-cmd="redis-cli ping" + --health-interval=10s + --health-timeout=5s + --health-retries=5 steps: - uses: actions/checkout@v4 - - name: Setup Node.js - uses: actions/setup-node@v4 + - name: Setup Python + uses: actions/setup-python@v5 with: - node-version: '22' - cache: 'npm' + python-version: '3.13' + - name: Install uv + run: pip install uv - name: Install dependencies - run: npm ci --ignore-scripts - - name: Install pip-platform native deps - run: npm rebuild sqlite3 bcrypt --workspace=farma-clic-pip-platform - - name: Run PIP Platform Tests - run: npm test --workspace=farma-clic-pip-platform + working-directory: apps/pip-platform + run: uv sync --extra dev + - name: Run Tests + working-directory: apps/pip-platform + run: uv run pytest