-
Notifications
You must be signed in to change notification settings - Fork 75
92 lines (81 loc) · 3.21 KB
/
safe-apps-e2e.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: Safe Apps E2E
on:
pull_request:
push:
branches:
- development
- main
jobs:
e2e:
runs-on: ubuntu-latest
name: Execute E2E tests
steps:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Checkout web-core
uses: actions/checkout@v3
with:
repository: safe-global/web-core
ref: main
path: web-core
- name: Yarn install web-core
working-directory: web-core
run: yarn install
- name: Yarn cache web-core modules
uses: actions/cache@v3
with:
path: 'web-core/**/node_modules'
key: web-core-modules-${{ hashFiles('**/yarn.lock') }}
- name: Build web-core
working-directory: web-core
run: yarn build && yarn export
env:
NEXT_PUBLIC_INFURA_TOKEN: ${{ secrets.CYPRESS_INFURA_TOKEN }}
NEXT_PUBLIC_SAFE_APPS_INFURA_TOKEN: ${{ secrets.CYPRESS_INFURA_TOKEN }}
NEXT_PUBLIC_TENDERLY_ORG_NAME: ${{ secrets.REACT_APP_TENDERLY_ORG_NAME }}
NEXT_PUBLIC_TENDERLY_PROJECT_NAME: ${{ secrets.REACT_APP_TENDERLY_PROJECT_NAME }}
NEXT_PUBLIC_TENDERLY_SIMULATE_ENDPOINT_URL: ${{ secrets.REACT_APP_TENDERLY_SIMULATE_ENDPOINT_URL }}
NEXT_PUBLIC_CYPRESS_MNEMONIC: ${{ secrets.CYPRESS_MNEMONIC }}
- name: Serve web-core
working-directory: web-core
run: |
yarn serve &
- name: Set PR Safe Apps base URL
run: |
echo "SAFE_APPS_BASE_URL=https://pr${{ github.event.number }}--safereactapps.review-react-hr.5afe.dev" >> $GITHUB_ENV
if: github.ref != 'refs/heads/development'
- name: Set development Safe Apps base URL
run: |
echo "SAFE_APPS_BASE_URL=https://safe-apps.dev.5afe.dev" >> $GITHUB_ENV
if: github.ref == 'refs/heads/development'
- name: Set main Safe Apps base URL
run: |
echo "SAFE_APPS_BASE_URL=https://apps-portal.safe.global" >> $GITHUB_ENV
if: ${{ github.ref == 'refs/heads/main' || github.event.schedule == '0 9 * * 1-5' }}
- name: Checkout safe-react-apps
uses: actions/checkout@v3
with:
repository: safe-global/safe-react-apps
path: apps
- name: Execute E2E tests
uses: cypress-io/github-action@v5
with:
browser: chrome
record: true
spec: cypress/e2e/drain-account/drain.spec.cy.js,cypress/e2e/tx-builder/tx-builder.spec.cy.js
wait-on: 'http://localhost:8080'
working-directory: apps
env:
CI: 'true'
CYPRESS_WEB_BASE_URL: 'http://localhost:8080'
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
CYPRESS_CHAIN_ID: '5'
CYPRESS_NETWORK_PREFIX: 'gor'
CYPRESS_TESTING_SAFE_ADDRESS: '0x168ca275d1103cb0a30980813140053c7566932F'
CYPRESS_CLIENT_GATEWAY_BASE_URL: 'https://safe-client.safe.global'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CYPRESS_DRAIN_SAFE_URL: ${{ env.SAFE_APPS_BASE_URL }}/drain-safe
CYPRESS_TX_BUILDER_URL: ${{ env.SAFE_APPS_BASE_URL }}/tx-builder
continue-on-error: false