fix(ci): fix parapharmacy-api and pip-platform test jobs, deploy with self-hosted runner
Run Tests on Branches / Detect Changes (push) Successful in 15s
Run Tests on Branches / Frontend Mobile Tests (push) Has been skipped
Run Tests on Branches / Backend Tests (push) Successful in 1m40s
Run Tests on Branches / Frontend Tests (push) Successful in 1m44s
Run Tests on Branches / Parapharmacy API Tests (push) Has been skipped
Run Tests on Branches / PIP Platform Tests (push) Failing after 1m38s
Run Tests on Branches / Detect Changes (push) Successful in 15s
Run Tests on Branches / Frontend Mobile Tests (push) Has been skipped
Run Tests on Branches / Backend Tests (push) Successful in 1m40s
Run Tests on Branches / Frontend Tests (push) Successful in 1m44s
Run Tests on Branches / Parapharmacy API Tests (push) Has been skipped
Run Tests on Branches / PIP Platform Tests (push) Failing after 1m38s
- Fix parapharmacy-api workspace name (farmafinder-parapharmacy-api) - Remove unnecessary sqlite3/bcrypt rebuild from parapharmacy-api tests - Add MongoDB service container for parapharmacy-api tests - Rewrite pip-platform tests: Node.js → Python (uv + pytest) - Add PostgreSQL and Redis services for pip-platform tests - Add pip-platform to detect-changes filter - Fix build-pip-platform trigger (was incorrectly referencing backend) - Switch deploy job to self-hosted runner with set -euo pipefail - Add .env sync from .env.example before deploy
This commit is contained in:
@@ -14,6 +14,7 @@ jobs:
|
||||
backend: ${{ steps.filter.outputs.backend }}
|
||||
frontend: ${{ steps.filter.outputs.frontend }}
|
||||
parapharmacy-api: ${{ steps.filter.outputs.parapharmacy-api }}
|
||||
pip-platform: ${{ steps.filter.outputs.pip-platform }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dorny/paths-filter@v3
|
||||
@@ -29,6 +30,8 @@ jobs:
|
||||
parapharmacy-api:
|
||||
- 'apps/parapharmacy-api/**'
|
||||
- 'packages/**'
|
||||
pip-platform:
|
||||
- 'apps/pip-platform/**'
|
||||
|
||||
test-backend:
|
||||
name: Backend Tests
|
||||
@@ -56,6 +59,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
|
||||
@@ -65,30 +73,52 @@ 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
|
||||
|
||||
test-frontend:
|
||||
name: Frontend Tests
|
||||
@@ -165,7 +195,7 @@ jobs:
|
||||
needs: [ detect-changes, test-pip-platform ]
|
||||
if: |
|
||||
always() &&
|
||||
needs.detect-changes.outputs.backend == 'true' &&
|
||||
needs.detect-changes.outputs.pip-platform == 'true' &&
|
||||
(needs.test-pip-platform.result == 'success' || needs.test-pip-platform.result == 'skipped')
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
Reference in New Issue
Block a user