-
Notifications
You must be signed in to change notification settings - Fork 5
138 lines (132 loc) · 3.82 KB
/
e2e_scoutcloud.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
name: E2E ScoutCloud
on:
push:
workflow_dispatch:
inputs:
rpc_url:
description: 'RPC URL'
required: true
default: 'https://sepolia.drpc.org'
type: string
server_size:
description: 'Server size'
required: true
default: 'small'
type: string
chain_type:
description: 'Chain type'
required: true
default: 'ethereum'
type: string
node_type:
description: 'Node type'
required: true
default: 'geth'
type: string
workflow_call:
inputs:
rpc_url:
description: 'RPC URL'
required: true
default: 'https://sepolia.drpc.org'
type: string
server_size:
description: 'Server size'
required: true
default: 'small'
type: string
chain_type:
description: 'Chain type'
required: true
default: 'ethereum'
type: string
node_type:
description: 'Node type'
required: true
default: 'geth'
type: string
env:
SCOUTCLOUD_URL: ${{ secrets.SCOUTCLOUD_URL }}
SCOUTCLOUD_TOKEN: ${{ secrets.SCOUTCLOUD_TOKEN }}
SCOUTCLOUD_RPC_URL: ${{ inputs.rpc_url }}
SCOUTCLOUD_SERVER_SIZE: ${{ inputs.server_size }}
SCOUTCLOUD_CHAIN_TYPE: ${{ inputs.chain_type }}
SCOUTCLOUD_NODE_TYPE: ${{ inputs.node_type }}
PWDEBUG: 0
LOAD_AUTH_CTX: 0
LOAD_CONTRACTS_DATA: 0
ACCOUNT: 1
PROD: 1
jobs:
e2e_tests:
name: Tests
permissions:
id-token: write
contents: read
runs-on: ubuntu-20.04
environment:
name: Tests
steps:
- name: checkout
uses: actions/checkout@v2
with:
repository: blockscout/blockscout-ci-cd
path: blockscout-ci-cd
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: v14.17.0
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install deps
working-directory: blockscout-ci-cd/tests/e2e
run: npm ci
- name: Build contracts
working-directory: blockscout-ci-cd/tests/contracts
run: |
# gyp build from root
npm config set user 0
npm ci
npm run build
- name: Cache playwright binaries
uses: actions/cache@v2
id: playwright-cache
with:
path: |
~/.cache/ms-playwright
key: ${{ runner.os }}-build-${{ env.cache-name }}
restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Set environment variables
run: |
echo "SCOUTCLOUD_RPC_URL=${{ inputs.rpc_url || 'https://sepolia.drpc.org' }}" >> $GITHUB_ENV
echo "SCOUTCLOUD_SERVER_SIZE=${{ inputs.server_size || 'small' }}" >> $GITHUB_ENV
echo "SCOUTCLOUD_CHAIN_TYPE=${{ inputs.chain_type || 'ethereum' }}" >> $GITHUB_ENV
echo "SCOUTCLOUD_NODE_TYPE=${{ inputs.node_type || 'geth' }}" >> $GITHUB_ENV
- name: Deploy and test ScoutCloud instance UI
working-directory: blockscout-ci-cd/tests/e2e
run: |
npx playwright install
npm run test:scoutcloud
- uses: actions/upload-artifact@v3
if: always()
with:
name: tests-results
path: blockscout-ci-cd/tests/e2e/test-results
- uses: actions/upload-artifact@v3
if: always()
with:
name: state
path: blockscout-ci-cd/tests/e2e/state.json
defaults:
run:
shell: bash