-
Notifications
You must be signed in to change notification settings - Fork 5
155 lines (152 loc) · 6.05 KB
/
Copy pathtest.yaml
File metadata and controls
155 lines (152 loc) · 6.05 KB
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
name: test
on:
push: { branches-ignore: [changesets-ghcommit-temp/**] } # cspell:ignore ghcommit
jobs:
test:
environment: test
runs-on: ubuntu-latest
env:
NX_DAEMON: false
REDISMS_SYSTEM_BINARY: /usr/bin/redis-server
BASE_RPC_URL: ${{ secrets.BASE_RPC_URL }}
ETHEREUM_RPC_URL: ${{ secrets.ETHEREUM_RPC_URL }}
OPTIMISM_RPC_URL: ${{ secrets.OPTIMISM_RPC_URL }}
OPTIMISM_SEPOLIA_RPC_URL: ${{ secrets.OPTIMISM_SEPOLIA_RPC_URL }}
POLYGON_RPC_URL: ${{ secrets.POLYGON_RPC_URL }}
steps:
- uses: actions/checkout@v7
with: { fetch-depth: 0, fetch-tags: true }
- uses: actions/setup-node@v7
with: { node-version: "^24.14.1" }
- uses: foundry-rs/foundry-toolchain@v1
with: { version: v1.7.1 }
- uses: actions/setup-python@v7
with:
python-version: "3.12"
cache: pip
cache-dependency-path: contracts/requirements.txt
- uses: actions/cache@v6
with:
path: .nx/cache
key: nx-${{ runner.os }}-${{ github.sha }}
restore-keys: nx-${{ runner.os }}-
- run: pip install -r contracts/requirements.txt
- run: |
mkdir -p $HOME/.local/bin && cd $HOME/.local/bin
streamingfast=""
arch=$(uname -m | sed "s/aarch64/arm64/")
for repo in firehose-ethereum substreams; do
curl -fsSL --retry 5 --retry-all-errors --retry-delay 2 "https://github.com/streamingfast/$repo/releases/latest/download/${repo}_linux_$arch.tar.gz" | tar zxf - &
streamingfast="$streamingfast $!"
done
for pid in $streamingfast; do wait "$pid" || exit 1; done
- run: echo ::add-matcher::.github/matcher.json
- run: sudo apt-get update && sudo apt-get install --no-install-recommends --yes redis-server
- run: corepack enable
- run: pnpm install --frozen-lockfile
- run: pnpm nx run-many -t test
- uses: codecov/codecov-action@v7
if: ${{ !cancelled() }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: test
- uses: codecov/codecov-action@v7
if: ${{ !cancelled() }}
with:
report_type: test_results
files: server/coverage/junit.xml
token: ${{ secrets.CODECOV_TOKEN }}
name: test
- uses: actions/upload-artifact@v7
if: ${{ !cancelled() }}
with:
name: server-artifacts
path: server/node_modules/@exactly/.*
include-hidden-files: true
e2e:
environment: test
runs-on: ubuntu-latest
timeout-minutes: 30
env:
NX_DAEMON: false
REDISMS_SYSTEM_BINARY: /usr/bin/redis-server
CHAIN_ID: "31337"
EXPO_PUBLIC_E2E_MNEMONIC: ${{ secrets.EXPO_PUBLIC_E2E_MNEMONIC }}
steps:
- uses: actions/checkout@v7
with: { fetch-depth: 0, fetch-tags: true }
- uses: actions/setup-node@v7
with: { node-version: "^24.14.1" }
- uses: foundry-rs/foundry-toolchain@v1
with: { version: v1.7.1 }
- uses: actions/cache@v6
with:
path: .nx/cache
key: nx-${{ runner.os }}-${{ github.sha }}
restore-keys: nx-${{ runner.os }}-
- uses: actions/setup-java@v5
with: { distribution: zulu, java-version: "17" }
- run: |
set -o pipefail
mkdir -p $HOME/.local/bin && cd $HOME/.local/bin
streamingfast=""
arch=$(uname -m | sed "s/aarch64/arm64/")
for repo in firehose-ethereum substreams; do
curl -fsSL --retry 5 --retry-all-errors --retry-delay 2 "https://github.com/streamingfast/$repo/releases/latest/download/${repo}_linux_$arch.tar.gz" | tar zxf - &
streamingfast="$streamingfast $!"
done
for pid in $streamingfast; do wait "$pid" || exit 1; done
for attempt in {1..5}; do
curl -fsSL "https://get.maestro.mobile.dev" | bash || true
[ -x $HOME/.maestro/bin/maestro ] && $HOME/.maestro/bin/maestro --version && echo $HOME/.maestro/bin >> "$GITHUB_PATH" && break
[ "$attempt" -eq 5 ] && echo "maestro install failed after 5 attempts" && exit 1
rm -rf $HOME/.maestro $HOME/.maestro.tmp
sleep 2
done
- run: echo ::add-matcher::.github/matcher.json
- run: sudo apt-get update && sudo apt-get install --no-install-recommends --yes redis-server
- run: corepack enable
- run: pnpm install --frozen-lockfile
- run: |
GITHUB_STEP_SUMMARY= pnpm nx run-many -t build -p mobile e2e
GITHUB_STEP_SUMMARY= pnpm nx generate:app server
pnpm nx e2e server > server.log 2>&1 &
pnpm dlx serve server/app -l 8081 -snL &
for i in {1..420}; do
curl -f http://localhost:3000/api/auth/authentication > /dev/null 2>&1 && break
[ $i -eq 420 ] && cat server.log && exit 1
sleep 1
done
CHROME_LOG_FILE=$PWD/chrome.log xvfb-run maestro test .maestro/flows/web.yaml --format junit --output .maestro/junit.xml
env: { APP_DOMAIN: localhost, EXPO_PUBLIC_ENV: e2e }
- if: always()
run: |
curl -X POST http://localhost:3000/e2e/shutdown || true
for i in {1..60}; do [ -f server/coverage/lcov.info ] && break; sleep 1; done
- uses: codecov/codecov-action@v7
if: ${{ !cancelled() }}
with:
files: server/coverage/lcov.info,server/coverage/app.json
token: ${{ secrets.CODECOV_TOKEN }}
flags: e2e
name: web
- uses: codecov/codecov-action@v7
if: ${{ !cancelled() }}
with:
report_type: test_results
files: .maestro/junit.xml
token: ${{ secrets.CODECOV_TOKEN }}
flags: e2e
name: web
- uses: actions/upload-artifact@v7
if: ${{ !cancelled() }}
with:
name: e2e-artifacts
path: |
chrome.log
server.log
server/coverage
server/node_modules/@exactly/.*
~/.maestro/tests
.maestro/screenshots
include-hidden-files: true