Implement the React-Native Pusher library for iOS and Android #234
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Verify HybridApp build | |
on: | |
pull_request: | |
types: [opened, synchronize] | |
branches-ignore: [staging, production] | |
paths: | |
- '**.kt' | |
- '**.java' | |
- '**.swift' | |
- '**.mm' | |
- '**.h' | |
- '**.cpp' | |
- 'package.json' | |
- 'patches/**' | |
- 'android/build.gradle' | |
- 'android/AndroidManifest.xml' | |
- 'ios/Podfile.lock' | |
- 'ios/project.pbxproj' | |
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 }} | |
- name: Update submodule to match main | |
run: | | |
git submodule update --init --remote --depth 1 | |
cd Mobile-Expensify | |
git checkout main | |
- name: Configure MapBox SDK | |
run: ./scripts/setup-mapbox-sdk.sh ${{ secrets.MAPBOX_SDK_DOWNLOAD_TOKEN }} | |
- name: Setup Node | |
id: setup-node | |
uses: ./.github/actions/composite/setupNode | |
with: | |
IS_HYBRID_BUILD: 'true' | |
- name: Setup Ruby | |
uses: ruby/[email protected] | |
with: | |
bundler-cache: true | |
- name: Build Android Debug | |
run: | | |
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 | |
fi | |
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 }} | |
- name: Update submodule to match main | |
run: | | |
git submodule update --init --remote --depth 1 | |
cd Mobile-Expensify | |
git checkout main | |
- name: Configure MapBox SDK | |
run: ./scripts/setup-mapbox-sdk.sh ${{ secrets.MAPBOX_SDK_DOWNLOAD_TOKEN }} | |
- name: Setup Node | |
id: setup-node | |
uses: ./.github/actions/composite/setupNode | |
with: | |
IS_HYBRID_BUILD: 'true' | |
- name: Setup Ruby | |
uses: ruby/[email protected] | |
with: | |
bundler-cache: true | |
- name: Cache Pod dependencies | |
uses: actions/cache@v4 | |
id: pods-cache | |
with: | |
path: Mobile-Expensify/iOS/Pods | |
key: ${{ runner.os }}-pods-cache-${{ hashFiles('Mobile-Expensify/iOS/Podfile.lock', 'firebase.json') }} | |
- name: Compare Podfile.lock and Manifest.lock | |
id: compare-podfile-and-manifest | |
run: echo "IS_PODFILE_SAME_AS_MANIFEST=${{ hashFiles('Mobile-Expensify/iOS/Podfile.lock') == hashFiles('Mobile-Expensify/iOS/Manifest.lock') }}" >> "$GITHUB_OUTPUT" | |
- name: Install cocoapods | |
uses: nick-fields/retry@3f757583fb1b1f940bc8ef4bf4734c8dc02a5847 | |
if: steps.pods-cache.outputs.cache-hit != 'true' || steps.compare-podfile-and-manifest.outputs.IS_PODFILE_SAME_AS_MANIFEST != 'true' || steps.setup-node.outputs.cache-hit != 'true' | |
with: | |
timeout_minutes: 10 | |
max_attempts: 5 | |
command: npm run pod-install | |
- name: Build iOS HybridApp | |
run: | | |
# Let us know if the builds fails | |
set -o pipefail | |
# Do not start metro | |
export RCT_NO_LAUNCH_PACKAGER=1 | |
# Build iOS using xcodebuild | |
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 | |
fi |