-
Notifications
You must be signed in to change notification settings - Fork 6
158 lines (139 loc) · 5.03 KB
/
ui-xcm-tests.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
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
name: FE Microapps XCM tests
on:
workflow_dispatch:
inputs:
feBranch:
description: "Name of the FE target branch"
type: string
required: false
default: "develop"
schedule:
- cron: "5 9 * * *"
jobs:
e2e-tm:
strategy:
fail-fast: false
matrix:
command:
[
"microappsTransferKSM",
"microappsTransferBNC",
"microappsTransferTUR",
]
runs-on: ubuntu-latest
timeout-minutes: 30
env:
API_URL: ws://127.0.0.1:9946
SELENIUM_REMOTE_URL: http://localhost:4444/wd/hub
UI_URL: http://localhost:5500
MANGATA_ASSETS_URL: https://storage.googleapis.com/mangata-assets
MANGATA_API_URL: ws://127.0.0.1:9946
MANGATA_EXPLORER_URL: https://mangatax.subscan.io
MANGATA_PARACHAIN_ID: 2110
MANGATA_TOKEN_ID: 0
MANGATA_ANNUAL_MGX_POOL_REWARDS: "300000000000000000000000000"
MANGATA_MAX_DELEGATION_COUNT: 30
MNEMONIC_POLK: "parrot reveal arena shrimp announce ten draw pretty forget caught advice jacket"
MNEMONIC_POLK_ECDSA: "catch alarm travel gravity crash pudding clip bike process wine virtual stamp"
MNEMONIC_POLK_ED25519: "nice say prison sword favorite sustain exit guitar own hen clip borrow"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
cache-dependency-path: "**/yarn.lock"
#### Selenoid
- name: Start Selenoid Server
uses: Xotabu4/selenoid-github-action@v2
with:
selenoid-start-arguments: |
--args "-timeout 300s" --browsers 'chrome:114.0'
#### App
- name: Checkout FE app
uses: actions/checkout@v3
with:
repository: mangata-finance/microapps
token: ${{ secrets.PRIVATE_FE_REPO_ACCESS_TOKEN }}
ref: "${{ github.event.inputs.feBranch || inputs.feBranch }}"
path: microapps
- name: Install app dependencies
working-directory: microapps
run: yarn
- name: Create env file and env variables
working-directory: microapps
run: |
ifconfig
IP_ADDRESS=$(ifconfig eth0 | awk '/inet / {print $2}')
echo "LOCAL_ADDRESS=$IP_ADDRESS" >> $GITHUB_ENV
echo "STASH_URL=https://mangata-stash-prod-dot-direct-pixel-353917.oa.r.appspot.com" >> $GITHUB_ENV
echo MANGATA_ASSETS_URL="https://storage.googleapis.com/mangata-assets" >> .env
echo MANGATA_STASH_URL="http://$IP_ADDRESS:3456" >> .env
echo MANGATA_EXPLORER_URL="https://mangatax.subscan.io" >> .env
echo MANGATA_API_URL=ws://$IP_ADDRESS:9946 >> .env
echo "MANGATA_API_URL=ws://$IP_ADDRESS:9946" >> $GITHUB_ENV
echo "API_URL=ws://$IP_ADDRESS:9946" >> $GITHUB_ENV
echo MANGATA_PARACHAIN_ID="2110" >> .env
echo MANGATA_ANNUAL_MGX_POOL_REWARDS="300000000000000000000000000" >> .env
echo MANGATA_MAX_DELEGATION_COUNT="30" >> .env
echo MANGATA_DEV_TOOLS=false >> .env
cat .env
- name: Install http-server
run: yarn global add http-server
- name: Build app
working-directory: microapps
run: yarn nx run-many --target=build
env:
NODE_OPTIONS: "--max_old_space_size=6144"
- name: Start app
working-directory: microapps
run: |
ifconfig
IP_ADDRESS=$(ifconfig eth0 | awk '/inet / {print $2}')
echo "UI_URL=http://$IP_ADDRESS:5500" >> $GITHUB_ENV
cd dist/packages/dex
http-server -p 5500 &
sleep 5s
- name: Install e2e tests dependencies
run: |
export SKIP_HUSKY=true
yarn
- name: is selenoid started?
run: |
curl http://localhost:4444/status
curl -I "$UI_URL"
- name: Run tests
run: |
echo ${{ env.UI_URL }}
yarn test-xcm-ui --group=${{ matrix.command }}
- name: Test Report
uses: dorny/[email protected]
if: always()
with:
name: E2E report ${{ matrix.command }} # Name of the check run which will be created
path: reports/*.xml # Path to test results
reporter: jest-junit # Format of test results
- name: Copy video files to reports folder
if: always()
run: |
# sleep is used to close buffers of videos
sleep 10s
cp ~/.aerokube/selenoid/* -r reports/artifacts/
- name: Create reports zip
uses: vimtor/action-zip@v1
if: always()
with:
files: reports/
dest: reports.zip
- name: Archive report files
uses: actions/[email protected]
if: always()
with:
name: ReportData ${{ matrix.command }}
path: reports.zip
- name: Archive report files
uses: actions/[email protected]
if: always()
with:
name: TestReport ${{ matrix.command }}
path: reports/html-report/report.html