fix: error: connect ENETUNREACH in render and change the port in mail… #49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Auth Mailer API CI | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| pull_request: | |
| branches: [ main, master ] | |
| defaults: | |
| run: | |
| working-directory: email-api | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:latest | |
| env: | |
| POSTGRES_USER: user_test | |
| POSTGRES_PASSWORD: password_test | |
| POSTGRES_DB: auth_mailer_test | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: email-api/package-lock.json | |
| - name: Install dependencies | |
| # 'npm ci' es más rápido y seguro en pipelines que 'npm install' | |
| run: npm ci | |
| - name: Run Tests | |
| env: | |
| # Inyectamos la URL de la base de datos del servicio de arriba | |
| DATABASE_URL: postgres://user_test:password_test@localhost:5432/auth_mailer_test | |
| SECRET_KEY: ${{ secrets.SECRET_KEY || 'test_secret_key' }} | |
| GOOGLE_APP_PASSWORD: ${{ secrets.GOOGLE_APP_PASSWORD }} | |
| EMAIL: ${{ secrets.EMAIL }} | |
| NODE_ENV: test | |
| # Forzamos que Node reconozca los módulos experimentales en el pipeline | |
| NODE_OPTIONS: "--experimental-vm-modules" | |
| run: npm test |