-
Notifications
You must be signed in to change notification settings - Fork 5
56 lines (49 loc) · 1.9 KB
/
cypress.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: 'Cypress tests'
on:
pull_request:
branches:
- develop
- main
jobs:
ubuntu-job:
name: 'Cypress on Ubuntu'
runs-on: ubuntu-latest # Can be self-hosted runner also
steps:
- name: 'Checkout the repository'
uses: actions/checkout@v2
- name: Upgrade npm to latest version
run: sudo npm i -g npm@latest
- name: 'Install Node Modules'
run: npm install
- name: Setting Environment Variables
env:
AUTH0_CLIENT_ID : ${{ secrets.AUTH0_CLIENT_ID }}
AUTH0_CUSTOM_DOMAIN: ${{ secrets.AUTH0_CUSTOM_DOMAIN }}
TEST_MFA_URL: ${{ secrets.TEST_MFA_URL }}
TEST_ACCOUNT_PASSWORD: ${{ secrets.TEST_ACCOUNT_PASSWORD }}
ESRI_CLIENT_ID: ${{ secrets.ESRI_CLIENT_ID }}
ESRI_CLIENT_SECRET: ${{ secrets.ESRI_CLIENT_SECRET }}
run: |
echo "APP_URL=http://localhost:3000" >> .env
echo "AUTH0_CLIENT_ID=$AUTH0_CLIENT_ID" >> .env
echo "AUTH0_CUSTOM_DOMAIN=$AUTH0_CUSTOM_DOMAIN" >> .env
echo "API_ENDPOINT=app-staging.plant-for-the-planet.org" >> .env
echo "CDN_URL=cdn.plant-for-the-planet.org/staging" >> .env
echo "ESRI_CLIENT_ID=$ESRI_CLIENT_ID" >> .env
echo "ESRI_CLIENT_SECRET=$ESRI_CLIENT_SECRET" >> .env
echo "SCHEME=https" >> .env
echo "{
\"TEST_SERVER\": \"localhost:3000\",
\"TEST_MFA_URL\": \"$TEST_MFA_URL\",
\"TEST_ACCOUNT_PASSWORD\": \"$TEST_ACCOUNT_PASSWORD\"
}" >> cypress.env.json
- name: 'Running Cypress tests'
run: |
cat .env > .env.production
npm run build && (npm run start & npm run cypress:run)
- name: 'Upload Artifact'
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: Cypress
path: /home/runner/work/planet-donations/planet-donations/cypress/videos/