Repository navigation
231 lines (225 loc) · 9.79 KB
/
Copy pathmobile.yml
File metadata and controls
231 lines (225 loc) · 9.79 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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
name: Mobile foundation
on:
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'scripts/apply-walletconnect-terminal.cjs'
- 'scripts/walletconnect-request-isolation.patch'
- 'scripts/walletconnect-terminal.json'
- 'scripts/apply-quickcrypto-sentry.cjs'
- 'scripts/quickcrypto-sentry.json'
- 'apps/mobile/**'
- 'package.json'
- 'yarn.lock'
- '.github/workflows/mobile-native-qualification.yml'
- 'source/shared/**'
- 'source/scripts/privacyProver/**'
- 'source/utils/privacy/prover*'
- 'scripts/build-number.cjs'
- 'scripts/build-native-private-prover.cjs'
- 'scripts/prepare-native-private-prover.cjs'
- 'source/wallet/**'
- 'source/utils/sentry/**'
- 'source/assets/locales/**'
- 'source/constants/trustedApps.json'
- 'source/types/network.ts'
- 'source/types/security.ts'
- 'source/types/utxoTransaction.ts'
- 'source/utils/accountCompatibility.ts'
- 'source/utils/asyncMutex.ts'
- 'source/utils/cleanErrorStack.ts'
- 'source/utils/dappApprovalLifetime.ts'
- 'source/utils/dappOrigin.ts'
- 'source/utils/defaultNetworks.ts'
- 'source/utils/ethersV6Compat.ts'
- 'source/utils/smartAccount/**'
- 'source/utils/evmNonce.ts'
- 'source/utils/evmReplacement.ts'
- 'source/utils/evmTransactionContext.ts'
- 'source/utils/nativeBalance.ts'
- 'source/utils/nftTokenId.ts'
- 'source/utils/personalSignReview.ts'
- 'source/utils/passkey/**'
- 'source/utils/privacy/note.ts'
- 'source/utils/privacy/merkle.ts'
- 'source/utils/privacy/merklePath.ts'
- 'source/utils/privacy/ownedAnchor.ts'
- 'source/utils/privacy/publicSyncProtocol.ts'
- 'source/utils/privacy/privateVaultTypes.ts'
- 'source/utils/privacy/registry.ts'
- 'source/utils/privacy/relayJobs.ts'
- 'source/utils/privacy/relayers.ts'
- 'source/utils/privacy/snapshotValidation.ts'
- 'source/utils/privacy/spentCompletion.ts'
- 'source/utils/privacy/withdrawalRecovery.ts'
- 'source/utils/privacy/trustedSnapshot.ts'
- 'source/utils/privacy/transactionTypes.ts'
- 'source/utils/privacy/types.ts'
- 'source/utils/privacy/withdrawalFees.ts'
- 'source/utils/privacy/withdrawalMetadata.ts'
- 'source/utils/privacy/withdrawalTransactionTypes.ts'
- 'source/utils/privacy/withdrawTypes.ts'
- 'source/utils/requestPayloadBudget.ts'
- 'source/utils/security/blacklistService.ts'
- 'source/utils/psbtWorkBudget.ts'
- 'source/utils/slhDsa/**'
- 'source/utils/syscoinAssetAmount.ts'
- 'source/utils/syscoinPsbtValues.ts'
- 'source/utils/utxoAcknowledgedInputs.ts'
- 'source/utils/tokenDiscovery.ts'
- 'source/utils/typedDataWorkBudget.ts'
- 'source/utils/typedOrderReview.ts'
- 'source/utils/watchOnlyIdentifier.ts'
- 'source/assets/all_assets/favicon-128.png'
- '.github/workflows/mobile.yml'
- '.github/scripts/configure-chromium-sandbox.sh'
- '.github/scripts/verify-playwright-apt-cache.sh'
- '.github/scripts/configure-playwright-apt-mirror.py'
- '.github/scripts/tests/configure-playwright-apt-mirror.test.cjs'
- '.github/scripts/with-playwright-apt-diagnostics.sh'
- '.github/scripts/playwright-apt-sudo.sh'
- '.github/scripts/tests/playwright-apt-bounds.test.cjs'
- '.github/scripts/tests/playwright-apt-sudo.test.cjs'
- '.github/scripts/tests/configure-chromium-sandbox.test.cjs'
- '.nvmrc'
permissions:
contents: read
concurrency:
group: mobile-foundation-${{ github.ref }}
cancel-in-progress: true
jobs:
foundation:
name: Mobile types, behavior and native bundles
runs-on: ubuntu-latest
# The measured full suite plus Android/iOS exports exceeds 30 minutes on hosted runners.
timeout-minutes: 60
defaults:
run:
working-directory: apps/mobile
env:
EXPO_NO_TELEMETRY: '1'
EXPO_NO_DOTENV: '1'
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7
with:
node-version-file: '.nvmrc'
cache: npm
cache-dependency-path: apps/mobile/package-lock.json
- run: npm ci --ignore-scripts
- run: npm run postinstall
- run: node scripts/qualification-sdk.cjs
- name: Check bounded native SLH guards and pinned profile
run: sh modules/pali-wallet-crypto/tests/run-slh-native.sh
- name: Reject moderate and higher dependency advisories
run: npm audit --audit-level=moderate
- run: npm run lint
- run: npm run typecheck
- run: npm test
# These validate the platform dependency graphs, not native binaries or
# device custody. Actual native custody is checked by its separate workflow.
- run: npx --no-install expo export --platform android --max-workers 2 --output-dir dist-android
- run: npx --no-install expo export --platform ios --max-workers 2 --output-dir dist-ios
browser:
name: Mobile browser (${{ matrix.suite }})
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
include:
- suite: preview
command: npm run test:ui
- suite: activity
command: npm run test:activity-ui
- suite: watch
command: npm run test:watch-ui -- --workers=2
- suite: faucet
command: npm run test:faucet-ui
- suite: recovery
command: npm run test:recovery-ui
defaults:
run:
working-directory: apps/mobile
env:
EXPO_NO_TELEMETRY: '1'
EXPO_NO_DOTENV: '1'
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7
with:
node-version-file: '.nvmrc'
cache: npm
cache-dependency-path: apps/mobile/package-lock.json
- run: npm ci --ignore-scripts
- run: npm run postinstall
- run: node scripts/qualification-sdk.cjs
- name: Build preview
if: matrix.suite == 'preview'
run: npm run build:web
- name: Resolve Playwright browser version
id: playwright-version
run: echo "version=$(node -p "require('playwright-core/package.json').version")" >> "$GITHUB_OUTPUT"
- name: Resolve OS package cache key
id: apt-cache-key
run: |
. /etc/os-release
echo "platform=${ID}-${VERSION_ID}-$(dpkg --print-architecture)" >> "$GITHUB_OUTPUT"
echo "week=$(date -u +%G-%V)" >> "$GITHUB_OUTPUT"
echo "image=${ImageVersion}" >> "$GITHUB_OUTPUT"
- name: Prepare sandboxed apt download archive
run: |
sudo install -d -o "$(id -u)" -g "$(id -g)" -m 0711 /var/cache/pali-playwright-apt
sudo install -d -o _apt -g root -m 0700 /var/cache/pali-playwright-apt/partial
- name: Restore Playwright OS package downloads
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: /var/cache/pali-playwright-apt/*.deb
key: playwright-apt-v1-${{ steps.apt-cache-key.outputs.platform }}-${{ steps.apt-cache-key.outputs.image }}-${{ steps.playwright-version.outputs.version }}-${{ hashFiles('yarn.lock', 'package.json', '.github/workflows/main.yml', '.github/scripts/verify-playwright-apt-cache.sh', '.github/scripts/configure-playwright-apt-mirror.py') }}-${{ steps.apt-cache-key.outputs.week }}
- name: Verify restored archives against fresh apt metadata
run: bash ../../.github/scripts/with-playwright-apt-diagnostics.sh bash ../../.github/scripts/verify-playwright-apt-cache.sh
- name: Configure temporary apt download archive
run: |
printf 'Dir::Cache::archives "%s";\nAPT::Keep-Downloaded-Packages "true";\nBinary::apt::APT::Keep-Downloaded-Packages "true";\n' \
/var/cache/pali-playwright-apt | sudo tee /etc/apt/apt.conf.d/99pali-playwright-cache >/dev/null
# The existing extension cache stores downloads only. Installation and
# sandbox admission still run on every mobile job.
- run: bash ../../.github/scripts/with-playwright-apt-diagnostics.sh npx --no-install playwright install --with-deps chromium
- name: Remove temporary apt configuration
if: always()
run: sudo rm -f /etc/apt/apt.conf.d/99pali-playwright-cache
- name: Validate Chromium sandbox helper admission
run: node --test ../../.github/scripts/tests/configure-chromium-sandbox.test.cjs
- name: Verify installed Chromium sandbox helper
run: bash ../../.github/scripts/configure-chromium-sandbox.sh
- name: Run browser suite
run: ${{ matrix.command }}
- name: Upload browser failure evidence
if: failure() || cancelled()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
with:
name: mobile-browser-${{ matrix.suite }}-${{ github.run_id }}-${{ github.run_attempt }}
path: |
apps/mobile/test-results/
apps/mobile/playwright-report/
if-no-files-found: ignore
retention-days: 14
validate:
name: Mobile types, behavior and bundles
if: always()
needs: [foundation, browser]
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- name: Require every mobile check
env:
FOUNDATION_RESULT: ${{ needs.foundation.result }}
BROWSER_RESULT: ${{ needs.browser.result }}
run: |
test "$FOUNDATION_RESULT" = success
test "$BROWSER_RESULT" = success