generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 2
74 lines (68 loc) · 2.09 KB
/
.tests.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
name: Test Workflow
on:
workflow_call:
inputs:
### Required
target:
description: 'PR number, test or prod.'
required: true
type: string
jobs:
integration-tests:
name: Integration Tests
runs-on: ubuntu-22.04
timeout-minutes: 1
steps:
- uses: actions/checkout@v4
- id: cache-npm
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-build-cache-node-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-cache-node-modules-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Integration tests
env:
API_NAME: nest
BASE_URL: https://${{ github.event.repository.name }}-${{ inputs.target }}-frontend.apps.silver.devops.gov.bc.ca
run: |
cd integration-tests
npm ci
node src/main.js
cypress-e2e:
name: E2E Tests
runs-on: ubuntu-22.04
defaults:
run:
working-directory: frontend
strategy:
matrix:
browser: [chrome, firefox, edge]
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- id: cache-npm
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-build-cache-node-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-cache-node-modules-
${{ runner.os }}-build-
${{ runner.os }}-
- uses: cypress-io/github-action@v6
name: Cypress run
env:
CYPRESS_baseUrl: https://${{ github.event.repository.name }}-${{ inputs.target }}-frontend.apps.silver.devops.gov.bc.ca/
with:
config: pageLoadTimeout=10000
working-directory: ./frontend
browser: ${{ matrix.browser }}
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-screenshots
path: ./cypress/screenshots
if-no-files-found: ignore # 'warn' or 'error' are also available, defaults to `warn`