Fix/current fix #27
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: Pre-Test Workflow | |
| on: | |
| pull_request: | |
| branches: [develop, staging, master, test] | |
| types: [opened, synchronize, reopened] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| path: . | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22.14 | |
| - uses: actions/cache@v4 | |
| id: npm-cache | |
| with: | |
| path: | | |
| ~/.npm | |
| **/node_modules | |
| **/.env.test | |
| **/.env.example | |
| key: ${{ runner.os }}-node-npm-${{ hashFiles('./package-lock.json', './.env.test', './.env.example') }} | |
| restore-keys: | | |
| ${{ runner.os }}-node-npm- | |
| - name: Install deps | |
| run: npm ci | |
| - name: build | |
| run: npm run build | |
| - name: Upload build result | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build_result | |
| path: dist/ | |
| test-api-unit: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - uses: actions/cache@v4 | |
| id: npm-cache | |
| with: | |
| path: | | |
| ~/.npm | |
| **/node_modules | |
| **/.env.test | |
| **/.env.example | |
| key: ${{ runner.os }}-node-npm-${{ hashFiles('./package-lock.json', './.env.test', './.env.example') }} | |
| - name: Run unit tests | |
| run: npm run test:unit | |
| test-api-int-e2e: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: cp .env.test-ci .env -f | |
| - run: cat .env | |
| - uses: actions/cache@v4 | |
| id: npm-cache | |
| with: | |
| path: | | |
| ~/.npm | |
| **/node_modules | |
| **/.env.test | |
| **/.env.example | |
| key: ${{ runner.os }}-node-npm-${{ hashFiles('./package-lock.json', './.env.test', './.env.example') }} | |
| - uses: isbang/compose-action@v1.5.1 | |
| with: | |
| compose-file: "docker-compose.yml" | |
| services: | | |
| postgres_tests | |
| - run: npm ci | |
| - name: Get build result artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: build_result | |
| path: dist/ | |
| - run: cp .env.test-ci .env.test -f | |
| - name: Run migrations | |
| run: npm run migration:test:run | |
| - name: Run ingegration and e2e tests | |
| run: npm run test:int | |
| - name: Run e2e tests | |
| run: npm run test:e2e |