miinventario-v2/.github/workflows/test.yml
rckrdmrd c24f889f70
Some checks failed
Build / Build Backend (push) Has been cancelled
Build / Build Mobile (TypeScript Check) (push) Has been cancelled
Lint / Lint Backend (push) Has been cancelled
Lint / Lint Mobile (push) Has been cancelled
Test / Backend E2E Tests (push) Has been cancelled
Test / Mobile Unit Tests (push) Has been cancelled
Build / Build Docker Image (push) Has been cancelled
[MIINVENTARIO] feat: Add exports, reports, integrations modules and CI/CD pipeline
- Add exports module with PDF/CSV/Excel generation
- Add reports module for inventory analytics
- Add POS integrations module
- Add database migrations for exports, movements and integrations
- Add GitHub Actions CI/CD workflow with Docker support
- Add mobile export and reports screens with tests
- Update epic documentation with traceability
- Add deployment and security guides

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 06:06:34 -06:00

119 lines
2.7 KiB
YAML

name: Test
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
jobs:
test-backend:
name: Backend E2E Tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: apps/backend
services:
postgres:
image: postgres:15-alpine
env:
POSTGRES_USER: miinventario
POSTGRES_PASSWORD: miinventario_pass
POSTGRES_DB: miinventario_test
ports:
- 5433:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis:7-alpine
ports:
- 6380:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
NODE_ENV: test
DB_HOST: localhost
DB_PORT: 5433
DB_USER: miinventario
DB_PASSWORD: miinventario_pass
DB_NAME: miinventario_test
REDIS_HOST: localhost
REDIS_PORT: 6380
JWT_SECRET: test-jwt-secret-for-ci
JWT_REFRESH_SECRET: test-jwt-refresh-secret-for-ci
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
cache-dependency-path: apps/backend/package-lock.json
- name: Install dependencies
run: npm ci
- name: Run migrations
run: npm run migration:run || true
- name: Run E2E tests
run: npm run test:e2e -- --coverage
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: backend-coverage
path: apps/backend/coverage/
retention-days: 7
test-mobile:
name: Mobile Unit Tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: apps/mobile
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
cache-dependency-path: apps/mobile/package-lock.json
- name: Install dependencies
run: npm ci
- name: Run unit tests
run: npm run test:ci
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: mobile-coverage
path: apps/mobile/coverage/
retention-days: 7
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: mobile-test-results
path: apps/mobile/junit.xml
retention-days: 7