4
4
workflow_dispatch :
5
5
6
6
jobs :
7
- build_wallet_app :
8
- name : Build Wallet App
9
- runs-on : macos-latest
7
+ build_apps :
8
+ name : Build ${{ matrix.app.name }} App
9
+ runs-on : macos-latest-xlarge
10
+ strategy :
11
+ fail-fast : false
12
+ matrix :
13
+ app :
14
+ - name : ' Wallet'
15
+ root_path : ' wallets/rn_cli_wallet'
16
+ google_services_secret : ' W3W_IOS_INTERNAL_GOOGLE_SERVICES_FILE'
17
+ sentry_file_secret : ' W3W_SENTRY_FILE'
18
+ sentry_dsn_secret : ' W3W_SENTRY_DSN'
19
+ pod_cache_key_suffix : ' wallet'
20
+ workspace : ' RNWeb3Wallet.xcworkspace'
21
+ scheme : ' RNWallet-Internal'
22
+ app_name_in_zip : ' RNWallet-Internal.app'
23
+ zip_name : ' wallet.zip'
24
+ artifact_name : ' rn_cli_wallet-internal-app'
25
+ artifact_path : ' wallets/rn_cli_wallet/wallet.zip'
26
+ - name : ' dApp'
27
+ root_path : ' dapps/W3MWagmi'
28
+ google_services_secret : ' EMPTY_SECRET' # This does not exist, so it will be an empty string
29
+ sentry_file_secret : ' W3M_WAGMI_SENTRY_FILE'
30
+ sentry_dsn_secret : ' W3M_WAGMI_SENTRY_DSN'
31
+ pod_cache_key_suffix : ' dapp'
32
+ workspace : ' W3MWagmi.xcworkspace'
33
+ scheme : ' W3MWagmi Internal'
34
+ app_name_in_zip : ' W3MWagmi Internal.app'
35
+ zip_name : ' dapp.zip'
36
+ artifact_name : ' W3MWagmi-internal-app'
37
+ artifact_path : ' dapps/W3MWagmi/dapp.zip'
10
38
steps :
11
39
- name : Checkout
12
40
uses : actions/checkout@v4
@@ -16,22 +44,22 @@ jobs:
16
44
with :
17
45
node-version : 18
18
46
19
- - name : Setup iOS files for Wallet
47
+ - name : Setup iOS files for ${{ matrix.app.name }}
20
48
uses : ./.github/actions/ci-setup-ios-files
21
49
with :
22
- root-path : ' wallets/rn_cli_wallet '
23
- google-services-file : ${{ secrets.W3W_IOS_INTERNAL_GOOGLE_SERVICES_FILE }}
24
- sentry-file : ${{ secrets.W3W_SENTRY_FILE }}
50
+ root-path : ${{ matrix.app.root_path }}
51
+ google-services-file : ${{ secrets[matrix.app.google_services_secret] }}
52
+ sentry-file : ${{ secrets[matrix.app.sentry_file_secret] }}
25
53
project-id : ${{ secrets.ENV_PROJECT_ID }}
26
54
relay-url : ${{ secrets.ENV_RELAY_URL }}
27
- sentry-dsn : ${{ secrets.W3W_SENTRY_DSN }}
55
+ sentry-dsn : ${{ secrets[matrix.app.sentry_dsn_secret] }}
28
56
release-type : ' internal'
29
57
30
58
- name : Set Xcode Version
31
59
run : sudo xcode-select -s /Applications/Xcode_16.2.app
32
60
33
61
- name : Install dependencies
34
- working-directory : ./wallets/rn_cli_wallet
62
+ working-directory : ./${{ matrix.app.root_path }}
35
63
run : |
36
64
yarn install --immutable
37
65
@@ -48,108 +76,43 @@ jobs:
48
76
id : pods-cache-wallet
49
77
uses : actions/cache@v4
50
78
with :
51
- path : wallets/rn_cli_wallet /ios/Pods
52
- key : ${{ runner.os }}-pods-wallet -${{ hashFiles('wallets/rn_cli_wallet/ ios/Podfile.lock') }}
79
+ path : ${{ matrix.app.root_path }} /ios/Pods
80
+ key : ${{ runner.os }}-pods-${{ matrix.app.pod_cache_key_suffix }} -${{ hashFiles(format('{0}/ ios/Podfile.lock', matrix.app.root_path) ) }}
53
81
restore-keys : |
54
- ${{ runner.os }}-pods-wallet -
82
+ ${{ runner.os }}-pods-${{ matrix.app.pod_cache_key_suffix }} -
55
83
56
84
- name : Install Pods
57
85
if : steps.pods-cache-wallet.outputs.cache-hit != 'true'
58
- working-directory : ./wallets/rn_cli_wallet /ios
86
+ working-directory : ./${{ matrix.app.root_path }} /ios
59
87
run : pod install
60
88
61
- - name : Build Wallet App for Simulator
62
- working-directory : ./wallets/rn_cli_wallet /ios
89
+ - name : Build ${{ matrix.app.name }} App for Simulator
90
+ working-directory : ./${{ matrix.app.root_path }} /ios
63
91
run : |
64
- set -o pipefail && xcodebuild -workspace RNWeb3Wallet.xcworkspace -scheme "RNWallet-Internal" -sdk iphonesimulator -derivedDataPath ./build -quiet
65
-
66
- - name : Create app package
67
- working-directory : ./wallets/rn_cli_wallet/ios
68
- run : |
69
- cd build/Build/Products/Debug-iphonesimulator
70
- zip -r ../../../../wallet.zip . -i "RNWallet-Internal.app"
71
-
72
- - name : Upload Wallet App
73
- uses : actions/upload-artifact@v4
74
- with :
75
- name : rn_cli_wallet-internal-app
76
- path : ./wallets/rn_cli_wallet/wallet.zip
77
-
78
- build_dapp_app :
79
- name : Build dApp App
80
- runs-on : macos-latest
81
- steps :
82
- - name : Checkout
83
- uses : actions/checkout@v4
84
-
85
- - name : Setup Node.js
86
- uses : actions/setup-node@v4
87
- with :
88
- node-version : 18
89
-
90
- - name : Setup iOS files for dApp
91
- uses : ./.github/actions/ci-setup-ios-files
92
- with :
93
- root-path : ' dapps/W3MWagmi'
94
- sentry-file : ${{ secrets.W3M_WAGMI_SENTRY_FILE }}
95
- project-id : ${{ secrets.ENV_PROJECT_ID }}
96
- relay-url : ${{ secrets.ENV_RELAY_URL }}
97
- sentry-dsn : ${{ secrets.W3M_WAGMI_SENTRY_DSN }}
98
- release-type : ' internal'
99
-
100
- - name : Set Xcode Version
101
- run : sudo xcode-select -s /Applications/Xcode_16.2.app
102
-
103
- - name : Install dependencies
104
- working-directory : ./dapps/W3MWagmi
105
- run : |
106
- yarn install --immutable
107
-
108
- - name : Install Ruby
109
- uses : ruby/setup-ruby@v1
110
- with :
111
- ruby-version : 3.1.0
112
- bundler-cache : true
113
-
114
- - name : Install Cocoapods
115
- run : gem install cocoapods
116
-
117
- - name : Cache pods
118
- id : pods-cache-dapp
119
- uses : actions/cache@v4
120
- with :
121
- path : dapps/W3MWagmi/ios/Pods
122
- key : ${{ runner.os }}-pods-dapp-${{ hashFiles('dapps/W3MWagmi/ios/Podfile.lock') }}
123
- restore-keys : |
124
- ${{ runner.os }}-pods-dapp-
125
-
126
- - name : Install Pods
127
- if : steps.pods-cache-dapp.outputs.cache-hit != 'true'
128
- working-directory : ./dapps/W3MWagmi/ios
129
- run : pod install
130
-
131
- - name : Build dApp App for Simulator
132
- working-directory : ./dapps/W3MWagmi/ios
133
- run : |
134
- set -o pipefail && xcodebuild -workspace W3MWagmi.xcworkspace -scheme "W3MWagmi Internal" -sdk iphonesimulator -derivedDataPath ./build -quiet
92
+ export SENTRY_DISABLE_AUTO_UPLOAD=true && set -o pipefail && xcodebuild -workspace ${{ matrix.app.workspace }} -scheme "${{ matrix.app.scheme }}" -configuration Release -sdk iphonesimulator -derivedDataPath ./build
135
93
94
+ - name : List build products
95
+ if : always()
96
+ working-directory : ./${{ matrix.app.root_path }}/ios
97
+ run : ls -R build
98
+
136
99
- name : Create app package
137
- working-directory : ./dapps/W3MWagmi /ios
100
+ working-directory : ./${{ matrix.app.root_path }} /ios
138
101
run : |
139
- cd build/Build/Products/Debug -iphonesimulator
140
- zip -r ../../../../dapp.zip . -i "W3MWagmi Internal .app"
102
+ cd build/Build/Products/Release -iphonesimulator
103
+ zip -r ../../../../${{ matrix.app.zip_name }} . -i "${{ matrix .app.app_name_in_zip }} "
141
104
142
- - name : Upload dApp App
105
+ - name : Upload ${{ matrix.app.name }} App
143
106
uses : actions/upload-artifact@v4
144
107
with :
145
- name : W3MWagmi-internal- app
146
- path : ./dapps/W3MWagmi/dapp.zip
108
+ name : ${{ matrix. app.artifact_name }}
109
+ path : ${{ matrix.app.artifact_path }}
147
110
148
111
run_e2e_tests :
149
112
name : Run E2E Tests
150
113
timeout-minutes : 60
151
114
runs-on : macos-14-xlarge
152
- needs : [build_wallet_app, build_dapp_app ]
115
+ needs : [build_apps ]
153
116
steps :
154
117
- name : Checkout repository
155
118
uses : actions/checkout@v4
@@ -181,11 +144,7 @@ jobs:
181
144
find apps -name "*.app" | xargs ls -la
182
145
183
146
- name : Install Maestro
184
- run : |
185
- curl -Ls "https://get.maestro.mobile.dev" | bash
186
- export PATH="$PATH":"$HOME/.maestro/bin"
187
- echo "$HOME/.maestro/bin" >> $GITHUB_PATH
188
- maestro --version
147
+ uses : ./.github/actions/ci-setup-maestro
189
148
190
149
- name : Run iOS Simulator and Tests
191
150
run : |
0 commit comments