Update README.md #33
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: CI Cypress - Testing e2e | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
backend: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout/Copy Repository | |
uses: actions/checkout@v3 | |
- name: Use Node.js 20 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Clone Backend Repository | |
run: git clone https://github.com/dkaerit/nest-api-rest.git | |
- name: Install NestJS CLI | |
run: npm install -g @nestjs/cli | |
- name: Install Backend Dependencies | |
working-directory: nest-api-rest | |
run: npm install | |
- name: Run Tests | |
working-directory: nest-api-rest | |
env: | |
TOKEN_SECRET: ${{ secrets.TOKEN_SECRET }} | |
DB_USERNAME: ${{ secrets.DB_USERNAME }} | |
DB_PASSWORD: ${{ secrets.DB_PASSWORD }} | |
run: npm run test | |
- name: Start Backend Server | |
working-directory: nest-api-rest | |
env: | |
TOKEN_SECRET: ${{ secrets.TOKEN_SECRET }} | |
DB_USERNAME: ${{ secrets.DB_USERNAME }} | |
DB_PASSWORD: ${{ secrets.DB_PASSWORD }} | |
run: npm run start & | |
frontend: | |
needs: backend | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout/Copy Repository | |
uses: actions/checkout@v3 | |
- name: Use Node.js 20 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Install Frontend Dependencies | |
working-directory: frontend | |
run: npm install | |
- name: Cypress run | |
uses: cypress-io/github-action@v3 | |
with: | |
working-directory: frontend | |
browser: chrome | |
start: npm run start | |
wait-on: "http://localhost:8080" | |
- name: Run Tests | |
working-directory: frontend | |
run: npm run test | |