-
Notifications
You must be signed in to change notification settings - Fork 5
139 lines (129 loc) · 4.13 KB
/
e2e_new.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
139
name: E2E tests account
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
schedule:
- cron: '*/180 * * * *'
workflow_dispatch:
workflow_call:
env:
BLOCKSCOUT_URL: ${{ secrets.E2E_BLOCKSCOUT_URL }}
FRONTEND_URL: ${{ secrets.E2E_FRONTEND_URL }}
NETWORK_URL: ${{ secrets.E2E_NETWORK_URL }}
ACCOUNT_USERNAME: ${{ secrets.ACCOUNT_USERNAME }}
ACCOUNT_PASSWORD: ${{ secrets.ACCOUNT_PASSWORD }}
MAILSLURP_API_KEY: ${{ secrets.MAILSLURP_API_KEY }}
MAILSLURP_EMAIL_ID: ${{ secrets.MAILSLURP_EMAIL_ID }}
ENV: test
RESOURCE_MODE: account
PUBLIC: false
PORT: 4000
PORT_PG: 5432
PORT_NETWORK_HTTP: 8545
PORT_NETWORK_WS: 8546
WALLET: ${{ secrets.WALLET }}
PWDEBUG: 0
LOAD_AUTH_CTX: 0
LOAD_CONTRACTS_DATA: 0
ACCOUNT: 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: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4
- name: Set environment variables
run: |
env_vars=${{ inputs.env_vars }}
for i in ${env_vars//,/ }
do
echo "$i" >> $GITHUB_ENV
echo "${{ inputs.appNamespace }}.${{ env.K8S_DOMAIN }}"
done
- 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: Lint
working-directory: blockscout-ci-cd/tests/e2e
run: npm run lint
- 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 }}
# check if instance is ready
- name: Check the deployed service URL
uses: jtalk/url-health-check-action@v2
with:
# Check the following URLs one by one sequentially
url: ${{ env.FRONTEND_URL }}|${{ env.NETWORK_URL }}|${{ env.BLOCKSCOUT_URL }}
#
# Follow redirects, or just report success on 3xx status codes
follow-redirect: false # Optional, defaults to "false"
# Fail this action after this many failed attempts
max-attempts: 30 # Optional, defaults to 1
# Delay between retries
retry-delay: 10s # Optional, only applicable to max-attempts > 1
# Retry all errors, including 404. This option might trigger curl upgrade.
retry-all: true # Optional, defaults to "false"
- name: Run playwright smoke suite
working-directory: blockscout-ci-cd/tests/e2e
run: |
npx playwright install
npm run test:smoke:account
- uses: actions/upload-artifact@v3
if: always()
with:
name: report
path: blockscout-ci-cd/tests/e2e/html-report/index.html
- 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