forked from bcgov/common-hosted-form-service
-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (49 loc) · 1.64 KB
/
cypress-ci.yaml
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
name: Cypress Tests
on:
workflow_dispatch:
inputs:
pr-number:
description: Pull request number
required: false
type: string
jobs:
cypress-run:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: cache
uses: actions/cache@v4
with:
path: "tests/functional"
key: node-modules-${{ hashFiles('tests/functional/package.json') }}
- name: Set variables
run: |
if [[ "${{ github.event.inputs.pr-number }}" != '' ]]; then
echo "PR_FINAL=pr-${{ github.event.inputs.pr-number }}" >> $GITHUB_ENV
else
echo "PR_FINAL=app" >> $GITHUB_ENV
- name: cypress install
uses: cypress-io/github-action@v6
with:
working-directory: '${{ github.workspace }}/tests/functional'
env:
CYPRESS_keycloakUsername: ${{secrets.keycloakUsername}}
CYPRESS_keycloakPassword: ${{secrets.keycloakPassword}}
CYPRESS_depEnv: $PR_FINAL
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-screenshots
path: '${{ github.workspace }}/tests/functional/screenshots'
# mkdir artifacts
# cp -r cypress/screenshots artifacts/screenshots
# - name: Archive Cypress report
#uses: actions/upload-artifact@v2
#with:
#name: cypress-report
#path: artifacts