Skip to content

Commit

Permalink
Merge branch 'main' into feature/allow-negative
Browse files Browse the repository at this point in the history
  • Loading branch information
pasyukevich committed Jan 30, 2025
2 parents 2e03057 + d46c4cc commit 0fe0e70
Show file tree
Hide file tree
Showing 285 changed files with 6,137 additions and 3,430 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ EXPENSIFY_ACCOUNT_ID_RECEIPTS=-1
EXPENSIFY_ACCOUNT_ID_REWARDS=-1
EXPENSIFY_ACCOUNT_ID_STUDENT_AMBASSADOR=-1
EXPENSIFY_ACCOUNT_ID_SVFG=-1
EXPENSIFY_ACCOUNT_ID_MANAGER_MCTEST=-1

FB_API_KEY=YOUR_API_KEY
FB_APP_ID=YOUR_APP_ID
Expand Down
6 changes: 0 additions & 6 deletions .eslintrc.changed.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ module.exports = {
],
},
overrides: [
{
files: ['src/pages/workspace/WorkspaceInitialPage.tsx', 'src/pages/home/report/PureReportActionItem.tsx', 'src/libs/SidebarUtils.ts'],
rules: {
'rulesdir/no-default-id-values': 'off',
},
},
{
files: ['**/libs/**/*.{ts,tsx}'],
rules: {
Expand Down
27 changes: 0 additions & 27 deletions .github/workflows/commentOnNativeFileChanged.yml

This file was deleted.

122 changes: 122 additions & 0 deletions .github/workflows/compareNDandODbuilds.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
name: Build and profile Android apps

on:
workflow_dispatch:

jobs:
buildHybridAppAndroid:
name: Build HybridApp Android
runs-on: ubuntu-latest-xl
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
token: ${{ secrets.OS_BOTIFY_TOKEN }}

- name: Update submodule to match main
run: |
git submodule update --init --remote
cd Mobile-Expensify
git fetch
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: Run grunt build
run: |
cd Mobile-Expensify
npm run grunt:build:shared
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'oracle'
java-version: '17'

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

- name: Install New Expensify Gems
run: bundle install

- name: Install 1Password CLI
uses: 1password/install-cli-action@v1

- name: Load files from 1Password
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
run: |
op document get --output ./upload-key.keystore upload-key.keystore
op document get --output ./android-fastlane-json-key.json android-fastlane-json-key.json
# Copy the keystore to the Android directory for Fullstory
cp ./upload-key.keystore Mobile-Expensify/Android
- name: Load Android upload keystore credentials from 1Password
id: load-credentials
uses: 1password/load-secrets-action@v2
with:
export-env: false
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
ANDROID_UPLOAD_KEYSTORE_PASSWORD: op://Mobile-Deploy-CI/Repository-Secrets/ANDROID_UPLOAD_KEYSTORE_PASSWORD
ANDROID_UPLOAD_KEYSTORE_ALIAS: op://Mobile-Deploy-CI/Repository-Secrets/ANDROID_UPLOAD_KEYSTORE_ALIAS
ANDROID_UPLOAD_KEY_PASSWORD: op://Mobile-Deploy-CI/Repository-Secrets/ANDROID_UPLOAD_KEY_PASSWORD

- name: Build Android Release
working-directory: Mobile-Expensify/Android
run: |
./gradlew --profile assembleRelease \
-Pandroid.injected.signing.store.file="./upload-key.keystore" \
-Pandroid.injected.signing.store.password=${{ steps.load-credentials.outputs.ANDROID_UPLOAD_KEYSTORE_PASSWORD }} \
-Pandroid.injected.signing.key.alias=${{ steps.load-credentials.outputs.ANDROID_UPLOAD_KEYSTORE_ALIAS }} \
-Pandroid.injected.signing.key.password=${{ steps.load-credentials.outputs.ANDROID_UPLOAD_KEY_PASSWORD }}
echo "Printing Gradle profile report:"
# Print the latest generated profile report
PROFILE_REPORT=$(find build/reports/profile -maxdepth 1 -type f)
cat "$PROFILE_REPORT"
buildStandaloneAndroid:
name: Build Standalone Android
runs-on: ubuntu-latest-xl
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.OS_BOTIFY_TOKEN }}

- 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: 'false'

- name: Decrypt keystore to sign the APK/AAB
run: gpg --batch --yes --decrypt --passphrase="${{ secrets.LARGE_SECRET_PASSPHRASE }}" --output my-upload-key.keystore my-upload-key.keystore.gpg
working-directory: android/app

- name: Build Android Release
working-directory: android
env:
MYAPP_UPLOAD_STORE_PASSWORD: ${{ secrets.MYAPP_UPLOAD_STORE_PASSWORD }}
MYAPP_UPLOAD_KEY_PASSWORD: ${{ secrets.MYAPP_UPLOAD_KEY_PASSWORD }}
run: |
./gradlew --profile assembleProductionRelease
echo "Printing Gradle profile report:"
# Print the latest generated profile report
PROFILE_REPORT=$(find build/reports/profile -maxdepth 1 -type f)
cat "$PROFILE_REPORT"
21 changes: 12 additions & 9 deletions .github/workflows/testBuildHybrid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
const pullRequest = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: '${{ env.PULL_REQUEST_NUMBER }}'',
pull_number: '${{ env.PULL_REQUEST_NUMBER }}',
});
const body = pullRequest.data.body;
Expand All @@ -89,7 +89,6 @@ jobs:
getOldDotBranchRef:
runs-on: ubuntu-latest
needs: getOldDotPR
if: ${{ needs.getOldDotPR.outputs.OLD_DOT_PR != '' }}
outputs:
OLD_DOT_REF: ${{ steps.getHeadRef.outputs.REF }}
steps:
Expand All @@ -100,9 +99,13 @@ jobs:
id: getHeadRef
run: |
set -e
echo "REF=$(gh pr view ${{ needs.getOldDotPR.outputs.OLD_DOT_PR }} -R 'Expensify/Mobile-Expensify' --json headRefOid --jq '.headRefOid')" >> "$GITHUB_OUTPUT"
if [[ ${{ needs.getOldDotPR.outputs.OLD_DOT_PR }} == '' ]]; then
echo "REF=" >> "$GITHUB_OUTPUT"
else
echo "REF=$(gh pr view ${{ needs.getOldDotPR.outputs.OLD_DOT_PR }} -R Expensify/Mobile-Expensify --json headRefOid --jq '.headRefOid')" >> "$GITHUB_OUTPUT"
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }}


postGitHubCommentBuildStarted:
Expand Down Expand Up @@ -148,7 +151,7 @@ jobs:
if: ${{ needs.getOldDotBranchRef.outputs.OLD_DOT_REF != '' }}
run: |
cd Mobile-Expensify
git fetch
git fetch origin ${{ needs.getOldDotBranchRef.outputs.OLD_DOT_REF }}
git checkout ${{ needs.getOldDotBranchRef.outputs.OLD_DOT_REF }}
- name: Configure MapBox SDK
Expand Down Expand Up @@ -259,7 +262,7 @@ jobs:
if: ${{ needs.getOldDotBranchRef.outputs.OLD_DOT_REF != '' }}
run: |
cd Mobile-Expensify
git fetch
git fetch origin ${{ needs.getOldDotBranchRef.outputs.OLD_DOT_REF }}
git checkout ${{ needs.getOldDotBranchRef.outputs.OLD_DOT_REF }}
- name: Configure MapBox SDK
Expand Down Expand Up @@ -311,9 +314,9 @@ jobs:
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
run: |
op document get --output ./OldApp_AdHoc.mobileprovision OldApp_AdHoc
op document get --output ./OldApp_AdHoc_Share_Extension.mobileprovision OldApp_AdHoc_Share_Extension
op document get --output ./OldApp_AdHoc_Notification_Service.mobileprovision OldApp_AdHoc_Notification_Service
op read op://Mobile-Deploy-CI/OldApp_AdHoc/OldApp_AdHoc.mobileprovision --force --out-file ./OldApp_AdHoc.mobileprovision
op read op://Mobile-Deploy-CI/OldApp_AdHoc_Share_Extension/OldApp_AdHoc_Share_Extension.mobileprovision --force --out-file ./OldApp_AdHoc_Share_Extension.mobileprovision
op read op://Mobile-Deploy-CI/OldApp_AdHoc_Notification_Service/OldApp_AdHoc_Notification_Service.mobileprovision --force --out-file ./OldApp_AdHoc_Notification_Service.mobileprovision
- name: Decrypt certificate
run: cd ios && gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output Certificates.p12 Certificates.p12.gpg
Expand Down
141 changes: 141 additions & 0 deletions .github/workflows/verifyHybridApp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
name: Verify HybridApp build

on:
workflow_call:
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:
verify_android:
name: Verify Android HybridApp builds on main
runs-on: ubuntu-latest-xl
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 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: Build Android Debug
working-directory: Mobile-Expensify/Android
run: |
if ! ./gradlew assembleDebug
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
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 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: Install New Expensify Gems
run: bundle install

- 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 ! 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
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
2 changes: 1 addition & 1 deletion Mobile-Expensify
Loading

0 comments on commit 0fe0e70

Please sign in to comment.