-
Notifications
You must be signed in to change notification settings - Fork 18
63 lines (56 loc) · 2.11 KB
/
Copy pathcypress.yaml
File metadata and controls
63 lines (56 loc) · 2.11 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
# This workflow will do a clean install of node dependencies, build the sample web ui in a docker container and run tests on the ui isolated from mps and rps
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Cypress CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
permissions:
contents: read
actions: read
jobs:
build:
permissions:
contents: read
actions: read
checks: write
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- name: Harden Runner
uses: step-security/harden-runner@bf7454d06d71f1098171f2acdf0cd4708d7b5920 # v2.20.0
with:
egress-policy: audit
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: ${{ matrix.node-version }}
- run: npm install cypress
- run: docker build . --file Dockerfile --tag vprodemo.azurecr.ui/samplewebui:latest
- run: docker run -d -p 4200:80 vprodemo.azurecr.ui/samplewebui:latest
- run: npm run cy-runner
- name: Publish Cypress Test Results
uses: dorny/test-reporter@a43b3a5f7366b97d083190328d2c652e1a8b6aa2 # v3.0.0
if: always()
with:
name: Cypress Tests
path: cypress-ui-test-output-*.xml
reporter: java-junit
fail-on-error: false
- name: Upload Cypress UI Test Results
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: always()
with:
name: sample-web-ui-ui-test
path: cypress-ui-test-output-*.xml
- name: Upload Cypress UI Images
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: always()
with:
name: sample-web-ui-ui-test-screenshots
path: /home/runner/work/sample-web-ui/sample-web-ui/cypress/screenshots/**/*.png