Skip to content

Commit 5d4767c

Browse files
chore: action ios improvements
1 parent d164358 commit 5d4767c

File tree

2 files changed

+70
-98
lines changed

2 files changed

+70
-98
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: 'Install Maestro'
2+
description: 'Install latest Maestro version'
3+
4+
runs:
5+
using: 'composite'
6+
steps:
7+
- name: 'Install Maestro'
8+
shell: bash
9+
run: |
10+
curl -Ls "https://get.maestro.mobile.dev" | bash
11+
export PATH="$PATH":"$HOME/.maestro/bin"
12+
echo "$HOME/.maestro/bin" >> $GITHUB_PATH
13+
maestro --version

.github/workflows/ci_e2e_tests_ios.yaml

Lines changed: 57 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,37 @@ on:
44
workflow_dispatch:
55

66
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'
1038
steps:
1139
- name: Checkout
1240
uses: actions/checkout@v4
@@ -16,22 +44,22 @@ jobs:
1644
with:
1745
node-version: 18
1846

19-
- name: Setup iOS files for Wallet
47+
- name: Setup iOS files for ${{ matrix.app.name }}
2048
uses: ./.github/actions/ci-setup-ios-files
2149
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] }}
2553
project-id: ${{ secrets.ENV_PROJECT_ID }}
2654
relay-url: ${{ secrets.ENV_RELAY_URL }}
27-
sentry-dsn: ${{ secrets.W3W_SENTRY_DSN }}
55+
sentry-dsn: ${{ secrets[matrix.app.sentry_dsn_secret] }}
2856
release-type: 'internal'
2957

3058
- name: Set Xcode Version
3159
run: sudo xcode-select -s /Applications/Xcode_16.2.app
3260

3361
- name: Install dependencies
34-
working-directory: ./wallets/rn_cli_wallet
62+
working-directory: ./${{ matrix.app.root_path }}
3563
run: |
3664
yarn install --immutable
3765
@@ -48,108 +76,43 @@ jobs:
4876
id: pods-cache-wallet
4977
uses: actions/cache@v4
5078
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)) }}
5381
restore-keys: |
54-
${{ runner.os }}-pods-wallet-
82+
${{ runner.os }}-pods-${{ matrix.app.pod_cache_key_suffix }}-
5583
5684
- name: Install Pods
5785
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
5987
run: pod install
6088

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
6391
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
13593
94+
- name: List build products
95+
if: always()
96+
working-directory: ./${{ matrix.app.root_path }}/ios
97+
run: ls -R build
98+
13699
- name: Create app package
137-
working-directory: ./dapps/W3MWagmi/ios
100+
working-directory: ./${{ matrix.app.root_path }}/ios
138101
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 }}"
141104
142-
- name: Upload dApp App
105+
- name: Upload ${{ matrix.app.name }} App
143106
uses: actions/upload-artifact@v4
144107
with:
145-
name: W3MWagmi-internal-app
146-
path: ./dapps/W3MWagmi/dapp.zip
108+
name: ${{ matrix.app.artifact_name }}
109+
path: ${{ matrix.app.artifact_path }}
147110

148111
run_e2e_tests:
149112
name: Run E2E Tests
150113
timeout-minutes: 60
151114
runs-on: macos-14-xlarge
152-
needs: [build_wallet_app, build_dapp_app]
115+
needs: [build_apps]
153116
steps:
154117
- name: Checkout repository
155118
uses: actions/checkout@v4
@@ -181,11 +144,7 @@ jobs:
181144
find apps -name "*.app" | xargs ls -la
182145
183146
- 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
189148

190149
- name: Run iOS Simulator and Tests
191150
run: |

0 commit comments

Comments
 (0)