generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (62 loc) · 2.36 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
name: .Tests
on:
workflow_call:
inputs:
### Required
# Nothing! Just make sure `secrets: inherit` is set in the caller
### Typical / recommended
target:
description: PR number, test or prod; defaults to PR number
default: ${{ github.event.number }}
type: string
triggers:
description: Deployment trigger; omit = build; e.g. ('backend/' 'frontend/')
required: false
type: string
jobs:
cypress:
name: Cypress
env:
CYPRESS_PASSWORD: ${{ secrets.CYPRESS_PASSWORD }}
CYPRESS_USERNAME: ${{ vars.CYPRESS_USERNAME }}
CYPRESS_LOGIN_SERVICE: ${{ vars.CYPRESS_LOGIN_SERVICE }}
VITE_SERVER_URL: https://${{ github.event.repository.name }}-${{ inputs.target }}-backend.apps.silver.devops.gov.bc.ca
VITE_ORACLE_SERVER_URL: https://nr-spar-${{ inputs.target }}-oracle-api.apps.silver.devops.gov.bc.ca
VITE_USER_POOLS_ID: ${{ vars.VITE_USER_POOLS_ID }}
VITE_USER_POOLS_WEB_CLIENT_ID: ${{ secrets.VITE_USER_POOLS_WEB_CLIENT_ID }}
VITE_ZONE: TEST
runs-on: ubuntu-24.04
steps:
# Check triggers (omitted or matched)
- uses: bcgov/[email protected]
id: triggers
with:
triggers: ${{ inputs.triggers }}
- if: steps.triggers.outputs.triggered == 'false'
run: echo "No tests required/triggered!"
- uses: actions/checkout@v4
if: steps.triggers.outputs.triggered == 'true'
- name: Run Cypress CI
if: steps.triggers.outputs.triggered == 'true'
uses: bcgov/[email protected]
with:
node_version: "18"
commands: |
npm ci
npm run cy:ci || true
dir: frontend
sonar_args: >
-Dsonar.organization=bcgov-sonarcloud
-Dsonar.javascript.lcov.reportPaths=cypress-coverage/lcov.info
-Dsonar.projectKey=nr-spar_frontend
-Dsonar.sources=src/
-Dsonar.exclusions=src/__test__/**/*
-Dsonar.exclusions=src/mock-server/**/*
-Dsonar.test.inclusions=cypress/e2e/smoke-test/**/*
sonar_token: ${{ secrets.SONAR_FRONTEND }}
- name: Upload videos
uses: actions/upload-artifact@v4
if: always()
with:
name: cypress-videos-chrome
path: /home/runner/work/nr-spar/nr-spar/frontend/cypress/videos/