Skip to content

Commit

Permalink
Merge pull request #55807 from Expensify/andrew-hybrid-build-follow-ups
Browse files Browse the repository at this point in the history
[No QA]Followups for HybridApp building on main test
  • Loading branch information
AndrewGable authored Feb 4, 2025
2 parents 4d414e2 + 2336b9a commit 90dd9b5
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 28 deletions.
51 changes: 27 additions & 24 deletions .github/workflows/verifyHybridApp.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Verify HybridApp build

on:
workflow_call:
pull_request:
types: [opened, synchronize]
branches-ignore: [staging, production]
Expand All @@ -24,23 +23,35 @@ concurrency:
cancel-in-progress: true

jobs:
comment_on_fork:
name: Comment on all PRs that are forks
# Only run on pull requests that *are* a fork
if: ${{ github.event.pull_request.head.repo.fork }}
runs-on: ubuntu-latest
steps:
- name: Comment on forks
run: |
gh pr comment ${{github.event.pull_request.html_url }} --body \
":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:"
env:
GITHUB_TOKEN: ${{ github.token }}
verify_android:
name: Verify Android HybridApp builds on main
runs-on: ubuntu-latest-xl
# Only run on pull requests that are *not* on a fork
if: ${{ !github.event.pull_request.head.repo.fork }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
ref: ${{ github.event.pull_request.head.sha }}
token: ${{ secrets.OS_BOTIFY_TOKEN }}
# fetch-depth: 0 is required in order to fetch the correct submodule branch
fetch-depth: 0

- name: Update submodule to match main
run: |
git submodule update --init --remote
git fetch
git submodule update --init --remote --depth 1
cd Mobile-Expensify
git checkout main
- name: Configure MapBox SDK
Expand All @@ -52,10 +63,14 @@ jobs:
with:
IS_HYBRID_BUILD: 'true'

- name: Setup Ruby
uses: ruby/[email protected]
with:
bundler-cache: true

- name: Build Android Debug
working-directory: Mobile-Expensify/Android
run: |
if ! ./gradlew assembleDebug
if ! npm run android-hybrid-build
then
echo "❌ Android HybridApp failed to build: Please reach out to Contributor+ and/or Expensify engineers for help in #expensify-open-source to resolve."
exit 1
Expand All @@ -64,20 +79,20 @@ jobs:
verify_ios:
name: Verify iOS HybridApp builds on main
runs-on: macos-15-xlarge
# Only run on pull requests that are *not* on a fork
if: ${{ !github.event.pull_request.head.repo.fork }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
ref: ${{ github.event.pull_request.head.sha }}
token: ${{ secrets.OS_BOTIFY_TOKEN }}
# fetch-depth: 0 is required in order to fetch the correct submodule branch
fetch-depth: 0

- name: Update submodule to match main
run: |
git submodule update --init --remote
git fetch
git submodule update --init --remote --depth 1
cd Mobile-Expensify
git checkout main
- name: Configure MapBox SDK
Expand All @@ -94,9 +109,6 @@ jobs:
with:
bundler-cache: true

- name: Install New Expensify Gems
run: bundle install

- name: Cache Pod dependencies
uses: actions/cache@v4
id: pods-cache
Expand Down Expand Up @@ -125,16 +137,7 @@ jobs:
export RCT_NO_LAUNCH_PACKAGER=1
# Build iOS using xcodebuild
if ! xcodebuild \
-workspace Mobile-Expensify/iOS/Expensify.xcworkspace \
-scheme Expensify \
-configuration Debug \
-sdk iphonesimulator \
-arch x86_64 \
CODE_SIGN_IDENTITY="" \
CODE_SIGNING_REQUIRED=NO \
CODE_SIGNING_ALLOWED=NO \
build | xcpretty
if ! npm run ios-hybrid-build
then
echo "❌ iOS HybridApp failed to build: Please reach out to Contributor+ and/or Expensify engineers for help in #expensify-open-source to resolve."
exit 1
Expand Down
17 changes: 13 additions & 4 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,7 @@ platform :android do
gradle(
project_dir: 'Mobile-Expensify/Android',
task: 'assemble',
flavor: 'Production',
build_type: 'Release',
build_type: 'Debug',
)
setGradleOutputsInEnv()
end
Expand Down Expand Up @@ -447,7 +446,12 @@ platform :ios do
ENV["ENVFILE"]=".env.production"
build_app(
workspace: "./ios/NewExpensify.xcworkspace",
scheme: "New Expensify"
scheme: "New Expensify",
configuration: "Debug",
sdk: "iphonesimulator",
skip_codesigning: true,
skip_archive: true,
export_method: "development"
)
setIOSBuildOutputsInEnv()
end
Expand All @@ -457,7 +461,12 @@ platform :ios do
ENV["ENVFILE"]="./Mobile-Expensify/.env.production.hybridapp.ios"
build_app(
workspace: "./Mobile-Expensify/iOS/Expensify.xcworkspace",
scheme: "Expensify"
scheme: "Expensify",
configuration: "Debug",
sdk: "iphonesimulator",
skip_codesigning: true,
skip_archive: true,
export_method: "development"
)
setIOSBuildOutputsInEnv()
end
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@
"detectRedirectCycle": "ts-node .github/scripts/detectRedirectCycle.ts",
"desktop-build-adhoc": "./scripts/build-desktop.sh adhoc",
"ios-build": "bundle exec fastlane ios build_unsigned",
"ios-hybrid-build": "bundle exec fastlane ios build_unsigned_hybrid",
"android-build": "bundle exec fastlane android build_local",
"android-hybrid-build": "bundle exec fastlane android build_local_hybrid",
"test": "TZ=utc NODE_OPTIONS=--experimental-vm-modules jest",
"perf-test": "NODE_OPTIONS=--experimental-vm-modules npx reassure",
"typecheck": "NODE_OPTIONS=--max_old_space_size=8192 tsc",
Expand Down

0 comments on commit 90dd9b5

Please sign in to comment.