-
Notifications
You must be signed in to change notification settings - Fork 97
113 lines (112 loc) · 5.4 KB
/
e2e-ios.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
name: E2E - iOS
on:
workflow_call:
inputs:
ios-version:
required: true
type: string
jobs:
ios:
env:
# `if` conditions can't directly access secrets, so we use a workaround
# See https://docs.github.com/en/actions/security-guides/encrypted-secrets#using-encrypted-secrets-in-a-workflow
SECRETS_AVAILABLE: ${{ secrets.SECRETS_AVAILABLE }}
BASH_ENV: ~/.profile
name: iOS (${{ inputs.ios-version }})
runs-on: ios-e2e-group
steps:
- uses: google-github-actions/auth@v2
if: ${{ env.SECRETS_AVAILABLE }}
with:
project_id: celo-mobile-mainnet
credentials_json: ${{ secrets.MAINNET_SERVICE_ACCOUNT_KEY }}
- name: Google Secrets
if: ${{ env.SECRETS_AVAILABLE }}
id: google-secrets
uses: google-github-actions/[email protected]
with:
secrets: |-
EMERGE_API_TOKEN:projects/1027349420744/secrets/EMERGE_API_TOKEN
E2E_WALLET_CONNECT_PROJECT_ID:projects/1027349420744/secrets/E2E_WALLET_CONNECT_PROJECT_ID
E2E_DEFAULT_RECIPIENT_MNEMONIC:projects/1027349420744/secrets/E2E_DEFAULT_RECIPIENT_MNEMONIC
E2E_DEFAULT_RECIPIENT_PRIVATE_KEY:projects/1027349420744/secrets/E2E_DEFAULT_RECIPIENT_PRIVATE_KEY
E2E_WALLET_MNEMONIC:projects/1027349420744/secrets/E2E_WALLET_MNEMONIC
E2E_WALLET_PRIVATE_KEY:projects/1027349420744/secrets/E2E_WALLET_PRIVATE_KEY
E2E_WALLET_SINGLE_VERIFIED_MNEMONIC:projects/1027349420744/secrets/E2E_WALLET_SINGLE_VERIFIED_MNEMONIC
E2E_WALLET_MULTIPLE_VERIFIED_MNEMONIC:projects/1027349420744/secrets/E2E_WALLET_MULTIPLE_VERIFIED_MNEMONIC
E2E_WALLET_12_WORDS_MNEMONIC:projects/1027349420744/secrets/E2E_WALLET_12_WORDS_MNEMONIC
- uses: actions/checkout@v4
- uses: ./.github/actions/yarn-install
# Since the e2e runners have access to the Valora branding,
# This check ensures there are no type errors there.
# The `yarn build` step done in the test workflow also includes it but does it with the default celo branding.
- name: TS check
run: yarn build:ts
- name: Install Ruby dependencies
run: bundle install --path vendor/bundle
- name: Fail if someone forgot to commit "Gemfile.lock"
run: git diff --exit-code
- name: Install CocoaPods dependencies
working-directory: ios
run: bundle exec pod install || bundle exec pod install --repo-update
- name: Fail if someone forgot to commit "Podfile.lock" and push changes if PR is from renovate
run: yarn ts-node ./.github/scripts/checkPodfileAndUpdateRenovatePr.ts
- name: Check E2E wallet balance
run: NODE_OPTIONS='--unhandled-rejections=strict' yarn ts-node ./e2e/scripts/check-e2e-wallet-balance.ts
- name: Create Detox Build
run: |
export CELO_TEST_CONFIG=e2e
yarn detox build -c ios.release
- name: Upload Detox Build to Emerge
if: |
env.SECRETS_AVAILABLE
&& (github.event_name == 'pull_request' || github.event_name == 'push' || github.event_name == 'merge_group')
# This step is not critical, so we continue on error
continue-on-error: true
run: yarn ts-node .github/scripts/uploadE2eBuildToEmerge.ts
env:
EMERGE_API_TOKEN: ${{ steps.google-secrets.outputs.EMERGE_API_TOKEN }}
DETOX_CONFIG: ios.release
- name: Run Detox
run: >
yarn detox test
--configuration ios.release.${{ inputs.ios-version }}
--artifacts-location e2e/artifacts
--take-screenshots=failing
--record-videos=failing
--record-logs=failing
--loglevel info
--debug-synchronization 10000
--maxWorkers 6
--retries 3
timeout-minutes: 45
env:
E2E_WALLET_CONNECT_PROJECT_ID: ${{ steps.google-secrets.outputs.E2E_WALLET_CONNECT_PROJECT_ID }}
E2E_DEFAULT_RECIPIENT_MNEMONIC: ${{ steps.google-secrets.outputs.E2E_DEFAULT_RECIPIENT_MNEMONIC }}
E2E_DEFAULT_RECIPIENT_PRIVATE_KEY: ${{ steps.google-secrets.outputs.E2E_DEFAULT_RECIPIENT_PRIVATE_KEY }}
E2E_WALLET_MNEMONIC: ${{ steps.google-secrets.outputs.E2E_WALLET_MNEMONIC }}
E2E_WALLET_PRIVATE_KEY: ${{ steps.google-secrets.outputs.E2E_WALLET_PRIVATE_KEY }}
E2E_WALLET_SINGLE_VERIFIED_MNEMONIC: ${{ steps.google-secrets.outputs.E2E_WALLET_SINGLE_VERIFIED_MNEMONIC }}
E2E_WALLET_MULTIPLE_VERIFIED_MNEMONIC: ${{ steps.google-secrets.outputs.E2E_WALLET_MULTIPLE_VERIFIED_MNEMONIC }}
E2E_WALLET_12_WORDS_MNEMONIC: ${{ steps.google-secrets.outputs.E2E_WALLET_12_WORDS_MNEMONIC }}
- name: Publish iOS JUnit Report
if: always()
uses: mikepenz/action-junit-report@v4
with:
check_name: iOS (${{ inputs.ios-version }}) e2e Test Report
report_paths: 'e2e/test-results/junit.xml'
- name: 'Upload iOS E2E Artifacts'
if: failure()
uses: actions/upload-artifact@v4
with:
name: ios-${{ inputs.ios-version }}-e2e-artifact
path: e2e/artifacts
- name: 'Upload iOS E2E HTML Report'
if: always()
uses: actions/upload-artifact@v4
with:
name: ios-${{ inputs.ios-version }}-test-report
path: e2e/test-results
- name: 'Close simulators'
if: always()
run: xcrun simctl shutdown all