Skip to content

Commit 90dd9b5

Browse files
authored
Merge pull request #55807 from Expensify/andrew-hybrid-build-follow-ups
[No QA]Followups for HybridApp building on main test
2 parents 4d414e2 + 2336b9a commit 90dd9b5

File tree

3 files changed

+42
-28
lines changed

3 files changed

+42
-28
lines changed

.github/workflows/verifyHybridApp.yml

+27-24
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
name: Verify HybridApp build
22

33
on:
4-
workflow_call:
54
pull_request:
65
types: [opened, synchronize]
76
branches-ignore: [staging, production]
@@ -24,23 +23,35 @@ concurrency:
2423
cancel-in-progress: true
2524

2625
jobs:
26+
comment_on_fork:
27+
name: Comment on all PRs that are forks
28+
# Only run on pull requests that *are* a fork
29+
if: ${{ github.event.pull_request.head.repo.fork }}
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Comment on forks
33+
run: |
34+
gh pr comment ${{github.event.pull_request.html_url }} --body \
35+
":warning: This PR is possibly changing native code, it may cause problems with HybridApp. Please run an AdHoc build to verify that HybridApp will not break. :warning:"
36+
env:
37+
GITHUB_TOKEN: ${{ github.token }}
2738
verify_android:
2839
name: Verify Android HybridApp builds on main
2940
runs-on: ubuntu-latest-xl
41+
# Only run on pull requests that are *not* on a fork
42+
if: ${{ !github.event.pull_request.head.repo.fork }}
3043
steps:
3144
- name: Checkout
3245
uses: actions/checkout@v4
3346
with:
3447
submodules: true
3548
ref: ${{ github.event.pull_request.head.sha }}
3649
token: ${{ secrets.OS_BOTIFY_TOKEN }}
37-
# fetch-depth: 0 is required in order to fetch the correct submodule branch
38-
fetch-depth: 0
3950

4051
- name: Update submodule to match main
4152
run: |
42-
git submodule update --init --remote
43-
git fetch
53+
git submodule update --init --remote --depth 1
54+
cd Mobile-Expensify
4455
git checkout main
4556
4657
- name: Configure MapBox SDK
@@ -52,10 +63,14 @@ jobs:
5263
with:
5364
IS_HYBRID_BUILD: 'true'
5465

66+
- name: Setup Ruby
67+
uses: ruby/[email protected]
68+
with:
69+
bundler-cache: true
70+
5571
- name: Build Android Debug
56-
working-directory: Mobile-Expensify/Android
5772
run: |
58-
if ! ./gradlew assembleDebug
73+
if ! npm run android-hybrid-build
5974
then
6075
echo "❌ Android HybridApp failed to build: Please reach out to Contributor+ and/or Expensify engineers for help in #expensify-open-source to resolve."
6176
exit 1
@@ -64,20 +79,20 @@ jobs:
6479
verify_ios:
6580
name: Verify iOS HybridApp builds on main
6681
runs-on: macos-15-xlarge
82+
# Only run on pull requests that are *not* on a fork
83+
if: ${{ !github.event.pull_request.head.repo.fork }}
6784
steps:
6885
- name: Checkout
6986
uses: actions/checkout@v4
7087
with:
7188
submodules: true
7289
ref: ${{ github.event.pull_request.head.sha }}
7390
token: ${{ secrets.OS_BOTIFY_TOKEN }}
74-
# fetch-depth: 0 is required in order to fetch the correct submodule branch
75-
fetch-depth: 0
7691

7792
- name: Update submodule to match main
7893
run: |
79-
git submodule update --init --remote
80-
git fetch
94+
git submodule update --init --remote --depth 1
95+
cd Mobile-Expensify
8196
git checkout main
8297
8398
- name: Configure MapBox SDK
@@ -94,9 +109,6 @@ jobs:
94109
with:
95110
bundler-cache: true
96111

97-
- name: Install New Expensify Gems
98-
run: bundle install
99-
100112
- name: Cache Pod dependencies
101113
uses: actions/cache@v4
102114
id: pods-cache
@@ -125,16 +137,7 @@ jobs:
125137
export RCT_NO_LAUNCH_PACKAGER=1
126138
127139
# Build iOS using xcodebuild
128-
if ! xcodebuild \
129-
-workspace Mobile-Expensify/iOS/Expensify.xcworkspace \
130-
-scheme Expensify \
131-
-configuration Debug \
132-
-sdk iphonesimulator \
133-
-arch x86_64 \
134-
CODE_SIGN_IDENTITY="" \
135-
CODE_SIGNING_REQUIRED=NO \
136-
CODE_SIGNING_ALLOWED=NO \
137-
build | xcpretty
140+
if ! npm run ios-hybrid-build
138141
then
139142
echo "❌ iOS HybridApp failed to build: Please reach out to Contributor+ and/or Expensify engineers for help in #expensify-open-source to resolve."
140143
exit 1

fastlane/Fastfile

+13-4
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,7 @@ platform :android do
120120
gradle(
121121
project_dir: 'Mobile-Expensify/Android',
122122
task: 'assemble',
123-
flavor: 'Production',
124-
build_type: 'Release',
123+
build_type: 'Debug',
125124
)
126125
setGradleOutputsInEnv()
127126
end
@@ -447,7 +446,12 @@ platform :ios do
447446
ENV["ENVFILE"]=".env.production"
448447
build_app(
449448
workspace: "./ios/NewExpensify.xcworkspace",
450-
scheme: "New Expensify"
449+
scheme: "New Expensify",
450+
configuration: "Debug",
451+
sdk: "iphonesimulator",
452+
skip_codesigning: true,
453+
skip_archive: true,
454+
export_method: "development"
451455
)
452456
setIOSBuildOutputsInEnv()
453457
end
@@ -457,7 +461,12 @@ platform :ios do
457461
ENV["ENVFILE"]="./Mobile-Expensify/.env.production.hybridapp.ios"
458462
build_app(
459463
workspace: "./Mobile-Expensify/iOS/Expensify.xcworkspace",
460-
scheme: "Expensify"
464+
scheme: "Expensify",
465+
configuration: "Debug",
466+
sdk: "iphonesimulator",
467+
skip_codesigning: true,
468+
skip_archive: true,
469+
export_method: "development"
461470
)
462471
setIOSBuildOutputsInEnv()
463472
end

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@
3939
"detectRedirectCycle": "ts-node .github/scripts/detectRedirectCycle.ts",
4040
"desktop-build-adhoc": "./scripts/build-desktop.sh adhoc",
4141
"ios-build": "bundle exec fastlane ios build_unsigned",
42+
"ios-hybrid-build": "bundle exec fastlane ios build_unsigned_hybrid",
4243
"android-build": "bundle exec fastlane android build_local",
44+
"android-hybrid-build": "bundle exec fastlane android build_local_hybrid",
4345
"test": "TZ=utc NODE_OPTIONS=--experimental-vm-modules jest",
4446
"perf-test": "NODE_OPTIONS=--experimental-vm-modules npx reassure",
4547
"typecheck": "NODE_OPTIONS=--max_old_space_size=8192 tsc",

0 commit comments

Comments
 (0)