Merge pull request #125 from Netsbump/feat/mobile-connexion #293
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: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| pull_request: | |
| branches: | |
| - main | |
| - develop | |
| jobs: | |
| lint: | |
| name: Lint Codebase | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 20 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: latest | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Run lint | |
| run: pnpm run lint | |
| build: | |
| name: Build Project | |
| runs-on: ubuntu-latest | |
| needs: lint | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 20 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: latest | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Run build | |
| run: pnpm build | |
| test: | |
| name: Run Tests | |
| runs-on: ubuntu-latest | |
| needs: build | |
| services: | |
| test-db: | |
| image: postgres:15-alpine | |
| ports: | |
| - 5433:5432 | |
| env: | |
| NODE_ENV: test | |
| POSTGRES_DB: dropit_test | |
| POSTGRES_USER: ${{ secrets.TEST_POSTGRES_USER }} | |
| POSTGRES_PASSWORD: ${{ secrets.TEST_POSTGRES_PASSWORD }} | |
| options: >- | |
| --health-cmd="pg_isready -U postgres" | |
| --health-interval=10s | |
| --health-timeout=5s | |
| --health-retries=5 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 20 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: latest | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Build dependencies | |
| run: pnpm run build | |
| - name: Run api tests | |
| working-directory: apps/api | |
| run: | | |
| pnpm run test:unit | |
| pnpm run test:integration | |
| env: | |
| API_PORT: 3001 | |
| NODE_ENV: test | |
| DB_USER: ${{ secrets.TEST_POSTGRES_USER }} | |
| DB_PASSWORD: ${{ secrets.TEST_POSTGRES_PASSWORD }} | |
| DB_NAME: dropit_test | |
| DB_HOST: localhost | |
| DB_PORT: 5433 | |
| BETTER_AUTH_SECRET: test-secret-for-ci | |
| TRUSTED_ORIGINS: "http://localhost:3000" |