generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 2
56 lines (48 loc) · 1.96 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
name: .Tests
on:
workflow_call:
inputs:
### Required
target:
description: PR number, test or prod
required: true
type: string
### Typical / recommended
triggers:
description: Bash array to diff for build triggering; omit to always fire
required: false
type: string
env:
DOMAIN: apps.silver.devops.gov.bc.ca
PREFIX: ${{ github.event.repository.name }}-${{ inputs.target }}
jobs:
cypress-tests:
env:
DOMAIN: apps.silver.devops.gov.bc.ca
PREFIX: ${{ github.event.repository.name }}-${{ inputs.target }}
runs-on: ubuntu-latest
steps:
- name: Checkout GitCode
uses: actions/checkout@v3
- name: Debug secrets
run: |
echo "Checking secrets..."
echo "auth_base_url: ${{ vars.KEYCLOAK_URL_DEV }}"
echo "auth_realm: ${{ vars.KEYCLOAK_REALM }}"
echo "keycloak_user: ${{ vars.KEYCLOAK_USER }}"
echo "keycloak_client_id: ${{ vars.KEYCLOAK_CLIENT_ID }}"
env:
KEYCLOAK_PASSWORD: ${{ secrets.KEYCLOAK_PASSWORD }}
- name: Run Cypress Test
uses: cypress-io/github-action@v5
with:
working-directory: ./frontend
command: npx cypress run --browser electron --config baseUrl=https://${{ env.PREFIX }}-frontend.${{ env.DOMAIN }} --env auth_base_url=${{ vars.KEYCLOAK_URL_DEV }},auth_realm=${{ vars.KEYCLOAK_REALM }},auth_client_id=${{ vars.KEYCLOAK_CLIENT_ID }},keycloak_user=${{ vars.KEYCLOAK_USER }},keycloak_user_02=${{ vars.KEYCLOAK_USER_02 }},keycloak_password=${{ secrets.KEYCLOAK_PASSWORD }}
- name: Upload Artifacts
uses: actions/upload-artifact@v3
if: always()
with:
name: cypress-artifacts
path: |-
/home/runner/work/nr-compliance-enforcement/nr-compliance-enforcement/frontend/cypress/videos/
/home/runner/work/nr-compliance-enforcement/nr-compliance-enforcement/frontend/cypress/screenshots/