-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (65 loc) · 2.02 KB
/
cypress.ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: CI Cypress - Testing e2e
on: ["push"]
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: Generar informes de cypress
working-directory: frontend
run: |
npm run coverage:lcov || true
ls -al
echo ""
ls -al coverage
- name: Coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.COVERALLS_REPO_TOKEN }}
file: "frontend/coverage/lcov.info"