-
Notifications
You must be signed in to change notification settings - Fork 39
87 lines (82 loc) · 2.89 KB
/
minespace.cypress.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Minespace WEB - Cypress Tests
on:
workflow_dispatch:
pull_request:
paths:
- services/common/**
- services/minespace-web/**
- services/core-api/**
- services/document-manager/**
jobs:
run-cypress-minespace:
name: run-cypress-minespace
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
name: checkout
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- uses: actions/setup-node@v3
with:
node-version: 20.x
- name: Install oc
uses: redhat-actions/openshift-tools-installer@v1
with:
oc: "4.7"
- name: oc login
run: |
oc login --token=${{ secrets.BUILD_TOKEN }} --server=${{ secrets.CLUSTER_API }}
- name: Set up env variables
run: |
INPUT=yes LOAD_EXTERNAL=yes make env
sed -i "s/NODE_ENV=.*/NODE_ENV=production/g" ./services/minespace-web/.env
- name: Run keycloak
run: |
make keycloak
- name: Install Dependencies
run: |
yarn
- name: Run app
run: |
ARTIFACTORY_TOKEN=${{ secrets.ARTIFACTORY_TOKEN }} EXTRA_SERVICES=minespace make be-minimal
- name: Seed database
run: |
make ENTRIES=10 seeddb
- name: Run cypress tests
run: yarn workspace @mds/minespace-web cypress run
env:
CYPRESS_TEST_USER: minespace-admin
CYPRESS_TEST_PASSWORD: cypress
CYPRESS_MINESPACE_WEB_TEST_URL: http://localhost:3020
CYPRESS_BACKEND: mds-python-backend
CYPRESS_API_URL: http://localhost:5000
CYPRESS_KEYCLOAK_URL: http://localhost:8080/auth
CYPRESS_ENVIRONMENT: local
CYPRESS_DOC_MAN_URL: http://localhost:5001
CYPRESS_MATOMO_URL: https://matomo-4c2ba9-test.apps.silver.devops.gov.bc.ca/
CYPRESS_KEYCLOAK_CLIENT_ID: mines-digital-services-mds-public-client-4414
CYPRESS_KEYCLOAK_RESOURCE: mines-digital-services-mds-public-client-4414
CYPRESS_KEYCLOAK_IDP_HINT: idir
CYPRESS_FILE_SYSTEM_PROVIDER_URL: https://mds-dev.apps.silver.devops.gov.bc.ca/file-api/AmazonS3Provider/
CYPRESS_FLAGSMITH_URL: https://mds-flags-dev.apps.silver.devops.gov.bc.ca/api/v1/
CYPRESS_FLAGSMITH_KEY: 4Eu9eEMDmWVEHKDaKoeWY7
- name: Upload cypress video
uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-recording
path: services/minespace-web/cypress/videos
- name: Collect docker logs on failure
if: failure()
uses: jwalton/gh-docker-logs@v2
with:
dest: "./logs"
- name: Tar logs
if: failure()
run: tar cvzf ./logs.tgz ./logs
- name: Upload logs to GitHub
if: failure()
uses: actions/upload-artifact@v3
with:
name: logs.tgz
path: ./logs.tgz