Repository navigation
80 lines (66 loc) · 1.86 KB
/
Copy pathe2e.yml
File metadata and controls
80 lines (66 loc) · 1.86 KB
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
79
80
name: E2E - Cypress smoke suite
on:
push:
branches: [DevOps]
pull_request:
workflow_dispatch:
concurrency:
group: e2e-${{ github.ref }}
cancel-in-progress: true
jobs:
cypress:
name: Build app, start stack, run Cypress
runs-on: ubuntu-latest
timeout-minutes: 30
defaults:
run:
working-directory: e2e
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: e2e/package-lock.json
- name: Cache Cypress binary
uses: actions/cache@v4
with:
path: ~/.cache/Cypress
key: cypress-${{ runner.os }}-${{ hashFiles('e2e/package-lock.json') }}
- name: Install Cypress
run: npm ci
- name: Build application image and start app + MySQL
run: npm run stack:up
- name: Seed database
run: npm run stack:seed
- name: Run smoke suite (headless)
run: npm run cy:run
- name: Collect container logs
if: failure()
run: |
mkdir -p logs
npm run -s stack:logs > logs/stack.log 2>&1 || true
- name: Archive screenshots, videos and logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: cypress-failure-artifacts
path: |
e2e/cypress/screenshots
e2e/cypress/videos
e2e/logs
if-no-files-found: ignore
retention-days: 14
- name: Archive videos (successful run)
if: success()
uses: actions/upload-artifact@v4
with:
name: cypress-videos
path: e2e/cypress/videos
if-no-files-found: ignore
retention-days: 7
- name: Tear down stack
if: always()
run: npm run stack:down