forked from bcgov/common-hosted-form-service
-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (53 loc) · 1.6 KB
/
Copy pathcypress-ci.yaml
File metadata and controls
60 lines (53 loc) · 1.6 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
name: Cypress Tests
on:
workflow_call:
inputs:
pr-number:
description: Pull request number
required: true
type: string
pr_branch:
required: true
type: string
secrets:
Username:
required: true
Password:
required: true
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
jobs:
cypress-run:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v5
with:
ref: ${{ inputs.pr_branch }} # Uses the PR branch from input
fetch-depth: 0 # Ensures the full history is fetched
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: '22'
cache: 'npm'
cache-dependency-path: 'tests/functional/cypress/package-lock.json'
- name: cypress install
uses: cypress-io/github-action@82482149c343a5dee155d22104111b9319f9dd45 # SHA for v7
with:
working-directory: 'tests/functional/cypress'
browser: chrome
env:
CYPRESS_keycloakUsername: ${{ secrets.Username }}
CYPRESS_keycloakPassword: ${{ secrets.Password }}
CYPRESS_depEnv: 'pr-${{ inputs.pr-number }}'
- uses: actions/upload-artifact@v6
if: always()
with:
name: cypress-axe-reports
path: '${{ github.workspace }}/tests/functional/cypress/axe-reports'
if-no-files-found: ignore
- uses: actions/upload-artifact@v6
if: failure()
with:
name: cypress-screenshots
path: '${{ github.workspace }}/tests/functional/cypress/screenshots'