2.15.1 #250
Workflow file for this run
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: Exploitation Tests | |
| on: | |
| pull_request: | |
| branches: [main] | |
| push: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: test-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| unit-tests: | |
| name: Jest Unit Tests | |
| runs-on: ubuntu-latest | |
| env: | |
| DATABASE_URL: "file:${{ github.workspace }}/prisma/test.db" | |
| MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Setup project | |
| uses: ./.github/actions/setup-project | |
| - name: Run unit tests | |
| run: npm run test:unit | |
| api-tests: | |
| name: Jest API Exploitation Tests | |
| runs-on: ubuntu-latest | |
| env: | |
| DATABASE_URL: "file:${{ github.workspace }}/prisma/test.db" | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Setup project | |
| uses: ./.github/actions/setup-project | |
| with: | |
| build: "true" | |
| - name: Start server and run API tests | |
| run: | | |
| npm run start & | |
| SERVER_PID=$! | |
| trap "kill $SERVER_PID || true" EXIT | |
| npx wait-on http://localhost:3000 --timeout 60000 | |
| npm run test:api | |
| e2e-tests: | |
| name: Cypress E2E Exploitation Tests | |
| runs-on: ubuntu-latest | |
| env: | |
| DATABASE_URL: "file:${{ github.workspace }}/prisma/test.db" | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Setup project | |
| uses: ./.github/actions/setup-project | |
| with: | |
| build: "true" | |
| - name: Run Cypress tests | |
| uses: cypress-io/github-action@783cb3f07983868532cabaedaa1e6c00ff4786a8 # v7.1.9 | |
| with: | |
| start: npm run start | |
| wait-on: "http://localhost:3000" | |
| wait-on-timeout: 60 | |
| - name: Upload Cypress screenshots on failure | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| if: failure() | |
| with: | |
| name: cypress-screenshots | |
| path: cypress/screenshots |