Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[No QA]Followups for HybridApp building on main test #55807

Merged
merged 26 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
27a2851
Update code, add debug
AndrewGable Jan 27, 2025
463e3eb
Tweak debug
AndrewGable Jan 27, 2025
53623ba
Use new npm command and fastfile
AndrewGable Jan 28, 2025
3e84a7d
Merge branch 'main' into andrew-hybrid-build-follow-ups
AndrewGable Jan 28, 2025
b4e188c
Add Android script too
AndrewGable Jan 28, 2025
e7a0759
Add env for forked PRs
AndrewGable Feb 3, 2025
13bbac4
Try no env to fix env
AndrewGable Feb 3, 2025
d7bef9d
Remove env and use if directly
AndrewGable Feb 3, 2025
a75800d
Merge branch 'main' into andrew-hybrid-build-follow-ups
AndrewGable Feb 3, 2025
fed9f59
Fix logic
AndrewGable Feb 3, 2025
88b5285
Add HybridApp fork comment
AndrewGable Feb 3, 2025
2a0726f
Update url
AndrewGable Feb 3, 2025
b136219
Remove debug
AndrewGable Feb 3, 2025
42ae684
Merge branch 'main' into andrew-hybrid-build-follow-ups
AndrewGable Feb 3, 2025
08101e8
Remove more debug
AndrewGable Feb 3, 2025
ae953f6
Update job name
AndrewGable Feb 3, 2025
835194a
Fix android build
AndrewGable Feb 3, 2025
93175a2
Add Debuggin
AndrewGable Feb 3, 2025
4c0763d
Set up ruby on Android runners
AndrewGable Feb 3, 2025
47aad8d
Tweak submodule update command
AndrewGable Feb 3, 2025
0aee2cf
Use different export method
AndrewGable Feb 3, 2025
5c49011
Try to skip archive as well
AndrewGable Feb 3, 2025
70dac04
Sync ios standalone and HybridApp settings
AndrewGable Feb 3, 2025
4b771fb
Revert M/E
AndrewGable Feb 3, 2025
236fc8f
Remove debugging
AndrewGable Feb 3, 2025
2336b9a
Remove bundle install
AndrewGable Feb 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 32 additions & 21 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 @@ -18,29 +17,43 @@ on:
- 'android/AndroidManifest.xml'
- 'ios/Podfile.lock'
- 'ios/project.pbxproj'
# TODO: Remove this line, just for debugging
- '**.yml'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still need to remove this, but will do so as the last commit before merge.


concurrency:
group: ${{ github.ref == 'refs/heads/main' && format('{0}-{1}', github.ref, github.sha) || github.ref }}-verify-main
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 +65,17 @@ jobs:
with:
IS_HYBRID_BUILD: 'true'

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

- name: Install New Expensify Gems
run: bundle install
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty sure that ruby/setup-ruby runs bundle install internally?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can confirm, it runs bundle install in setup-ruby:

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! Will remove


- 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 +84,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 Down Expand Up @@ -125,16 +145,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
2 changes: 1 addition & 1 deletion Mobile-Expensify
14 changes: 10 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',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems fine, but I wonder if we can do an unsigned release build?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we can without keys

build_type: 'Release',
build_type: 'Debug',
)
setGradleOutputsInEnv()
end
Expand Down Expand Up @@ -458,7 +457,10 @@ 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
)
setIOSBuildOutputsInEnv()
end
Expand All @@ -468,7 +470,11 @@ 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,
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
Loading