-
Notifications
You must be signed in to change notification settings - Fork 13
126 lines (109 loc) · 4.66 KB
/
_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
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
name: TS End-to-end Tests
on:
workflow_call:
inputs:
isRust:
type: boolean
required: false
isExplorer:
type: boolean
required: false
isAppsBackend:
type: boolean
required: false
isTypescriptSDK:
type: boolean
required: false
isWallet:
type: boolean
required: false
isGraphQlTransport:
type: boolean
required: false
concurrency:
group: e2e-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
RUST_LOG: warn
jobs:
# Run e2e test against localnet built on the develop branch
localnet:
name: Localnet
if: inputs.isExplorer || inputs.isTypescriptSDK || inputs.isWallet || inputs.isRust || github.ref_name == 'develop'
runs-on: self-hosted
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgrespw
POSTGRES_DB: iota_indexer
POSTGRES_HOST_AUTH_METHOD: trust
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
- run: cargo build --bin iota --features indexer --profile dev
- name: Install Nodejs
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version: "20"
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Install Playwright Browsers
run: pnpm --filter iota-explorer playwright install --with-deps chromium
- name: Set env
run: |
echo "VITE_IOTA_BIN=$PWD/target/debug/iota" >> $GITHUB_ENV
echo "E2E_RUN_LOCAL_NET_CMD=(RUST_BACKTRACE=1 $(echo $PWD/target/debug/iota) start --with-faucet --force-regenesis --with-indexer --with-graphql)" >> $GITHUB_ENV
- name: Run TS SDK e2e tests
if: inputs.isTypescriptSDK || inputs.isRust || github.ref_name == 'develop'
run: pnpm dlx concurrently --kill-others --success command-1 "$E2E_RUN_LOCAL_NET_CMD" 'pnpm --filter @iota/iota-sdk test:e2e'
- name: Run RPC/GraphQL compatibility e2e tests
if: inputs.isGraphQlTransport || inputs.isRust || github.ref_name == 'develop'
run: pnpm dlx concurrently --kill-others --success command-1 "$E2E_RUN_LOCAL_NET_CMD" 'pnpm --filter @iota/graphql-transport test:e2e'
- name: Build apps-backend
if: inputs.isAppsBackend || github.ref_name == 'develop'
run: pnpm --filter apps-backend build
- name: Run apps-backend e2e tests
if: inputs.isAppsBackend || github.ref_name == 'develop'
run: pnpm --filter apps-backend test:e2e
- name: Build explorer
if: inputs.isTypescriptSDK || inputs.isExplorer || inputs.isRust || github.ref_name == 'develop'
run: pnpm turbo --filter=iota-explorer build
- name: Run Explorer e2e tests
if: inputs.isTypescriptSDK || inputs.isExplorer || inputs.isRust || github.ref_name == 'develop'
run: pnpm --filter iota-explorer playwright test
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
if: always()
with:
name: playwright-report-explorer
path: apps/explorer/playwright-report/
retention-days: 30
- name: Build Kiosk
if: inputs.isRust || inputs.isTypescriptSDK
run: pnpm turbo --filter=@iota/kiosk build
- name: Run Kiosk e2e tests
if: inputs.isRust || inputs.isTypescriptSDK
run: pnpm dlx concurrently --kill-others --success command-1 "$E2E_RUN_LOCAL_NET_CMD" 'pnpm --filter=@iota/kiosk test:e2e'
- name: Run Local net
run: cargo run --bin iota start --force-regenesis --with-faucet --epoch-duration-ms 10000 &
- name: Build Wallet
if: inputs.isWallet || inputs.isRust || inputs.isTypescriptSDK || github.ref_name == 'develop'
run: pnpm wallet build
- name: Run Wallet e2e tests
if: inputs.isWallet || inputs.isRust || inputs.isTypescriptSDK || github.ref_name == 'develop'
run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- pnpm --filter iota-wallet playwright test
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
if: always()
with:
name: playwright-report-wallet
path: apps/wallet/playwright-report/
retention-days: 30