Test/add test e2e #172
This file contains 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: Main CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build-backend: | |
name: Build Backend | |
uses: ./.github/workflows/build.yml | |
with: | |
image: ghcr.io/dnum-mi/referentiel-applications/backend | |
context: ./server | |
build-frontend: | |
name: Build Frontend | |
uses: ./.github/workflows/build.yml | |
with: | |
image: ghcr.io/dnum-mi/referentiel-applications/frontend | |
context: ./client | |
test-format: | |
name: Test Formatting | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run Prettier check | |
run: | | |
npm ci | |
npm run format-check | |
test-e2e: | |
name: Run Cypress E2E Tests | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
needs: | |
- build-frontend | |
if: (!github.event.pull_request.draft) | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Install dependencies | |
working-directory: ./client | |
run: | | |
npm ci | |
- name: Start application for E2E tests | |
run: | | |
nohup npm run dev > /dev/null 2>&1 & | |
npx wait-on http://localhost:5713 | |
- name: Debug logs | |
run: | | |
ps aux | grep node | |
netstat -tuln | |
- name: Run Cypress tests | |
working-directory: ./client | |
run: npx cypress run |