From 8d86aca7b259c680ef85ddac25452f865a86a657 Mon Sep 17 00:00:00 2001 From: gdeluna-branch Date: Mon, 16 Jun 2025 15:57:44 -0700 Subject: [PATCH 01/10] Create gptdriverautomation.yaml --- .github/workflows/gptdriverautomation.yaml | 125 +++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 .github/workflows/gptdriverautomation.yaml diff --git a/.github/workflows/gptdriverautomation.yaml b/.github/workflows/gptdriverautomation.yaml new file mode 100644 index 000000000..477a93899 --- /dev/null +++ b/.github/workflows/gptdriverautomation.yaml @@ -0,0 +1,125 @@ +name: iOS Release Build and GPTDriver Tests + +on: + push: + branches: + - 'Release-*' # Trigger for branches starting with "Release-" + +jobs: + BuildAndTestAppOnGPTDriver: # Job name, as chosen + runs-on: macos-latest # macOS runner is required for iOS builds + steps: + # --- Step 1: Extract version from branch name --- + - name: Extract version from branch name + id: extract_version_step + run: | + BRANCH_NAME="${{ github.ref }}" + # Remove 'refs/heads/' prefix (e.g., refs/heads/Release-0.0.0 -> Release-0.0.0) + BRANCH_NAME_WITHOUT_PREFIX="${BRANCH_NAME#refs/heads/}" + # Extract version after "Release-" (e.g., Release-0.0.0 -> 0.0.0) + VERSION=$(echo "$BRANCH_NAME_WITHOUT_PREFIX" | sed -n 's/^Release-\([0-9]*\.[0-9]*\.[0-9]*\)$/\1/p') + + if [ -z "$VERSION" ]; then + echo "Error: Could not extract version from branch name '$BRANCH_NAME_WITHOUT_PREFIX'. Expected format: Release-X.Y.Z" + exit 1 + fi + + echo "Extracted versionName: $VERSION" + echo "VERSION_STRING=$VERSION" >> $GITHUB_ENV + + # Convert semantic version to an integer for CFBundleVersion (versionCode equivalent) + # Example: 1.2.3 -> 102003 (assuming max 2 digits for minor/patch) + # This should be adjusted based on the maximum expected values for major/minor/patch + MAJOR=$(echo "$VERSION" | cut -d. -f1) + MINOR=$(echo "$VERSION" | cut -d. -f2) + PATCH=$(echo "$VERSION" | cut -d. -f3) + + # Calculate versionCode (CFBundleVersion) - ensure this fits in a 32-bit integer + # Standard Android-like conversion: Major * 10000 + Minor * 100 + Patch + # This provides sufficient uniqueness for most common versioning schemes. + VERSION_CODE_INT=$(( MAJOR * 10000 + MINOR * 100 + PATCH )) + echo "Calculated versionCode: $VERSION_CODE_INT" + echo "VERSION_CODE_INT=$VERSION_CODE_INT" >> $GITHUB_ENV + + + # --- Step 2: Checkout the iOS Branch SDK repository --- + - name: Checkout BranchMetrics/ios-branch-deep-linking-attribution (SDK) + uses: actions/checkout@v4 + with: + repository: BranchMetrics/ios-branch-deep-linking-attribution + ref: ${{ github.ref }} # Use the same branch that triggered the workflow + path: ./branch-ios-sdk-repo # Checkout into a subdirectory + + # --- Step 3: Build the iOS Branch SDK Framework --- + - name: Build Branch SDK Framework + run: | + # Build for simulator. Adjust scheme if necessary. + # The output framework will be in build/Debug-iphonesimulator/BranchSDK.framework + xcodebuild build -project Branch-SDK/Branch-SDK.xcodeproj \ + -scheme BranchSDK \ + -configuration Debug \ + -sdk iphonesimulator \ + BUILD_DIR="${{ github.workspace }}/branch-ios-sdk-repo/build" \ + SKIP_INSTALL=NO + working-directory: ./branch-ios-sdk-repo # Run xcodebuild from the SDK's checkout directory + + # --- Step 4: Checkout the iOS Branch Link Simulator App repository --- + - name: Checkout BranchMetrics/BranchLinkSimulator (App) + uses: actions/checkout@v4 + with: + repository: BranchMetrics/BranchLinkSimulator + ref: gptdriver/linkingTests # Checkout the specific app branch + path: ./ios-app-repo # Checkout into another subdirectory + + # --- Step 5: Copy the generated SDK Framework to the App's project --- + - name: Copy generated SDK Framework to App's libs directory + run: | + # Create a 'Frameworks' directory within the app repo for the local SDK + mkdir -p ./ios-app-repo/Frameworks + # Copy the built framework + cp -R ./branch-ios-sdk-repo/build/Debug-iphonesimulator/BranchSDK.framework ./ios-app-repo/Frameworks/ + working-directory: ${{ github.workspace }} # Run from the root of the GITHUB_WORKSPACE + + # --- Step 6: Build the iOS Branch Link Simulator App using the local SDK Framework --- + - name: Build iOS App with local SDK + run: | + # Build the app. Adjust project/workspace, scheme, and destination if necessary. + # We're passing MARKETING_VERSION (versionName) and CURRENT_PROJECT_VERSION (versionCode) + xcodebuild build -project BranchLinkSimulator.xcodeproj \ + -scheme BranchLinkSimulator \ + -configuration Debug \ + -sdk iphonesimulator \ + -destination 'platform=iOS Simulator,name=iPhone 15' \ + MARKETING_VERSION=${{ env.VERSION_STRING }} \ + CURRENT_PROJECT_VERSION=${{ env.VERSION_CODE_INT }} \ + # Adjust Framework Search Paths if your Xcode project doesn't automatically find it + # For example, if you need to point directly to the copied framework: + # FRAMEWORK_SEARCH_PATHS="$(SRCROOT)/Frameworks" + working-directory: ./ios-app-repo # Run xcodebuild from the App's checkout directory + + # --- Step 7: Echo the location of the generated .app bundle --- + - name: Echo .app bundle location + run: | + APP_PATH="./ios-app-repo/build/Debug-iphonesimulator/BranchLinkSimulator.app" + echo "Generated .app bundle location: $APP_PATH" + # You can also use 'find' to be more dynamic if the name might change + # find ./ios-app-repo/build -name "*.app" + + # --- Step 8: Upload Build Artifacts --- + - name: Upload Build Artifacts + uses: actions/upload-artifact@v4 + with: + name: BranchLinkSimulator-iOS-Debug-Build + path: ./ios-app-repo/build/Debug-iphonesimulator/BranchLinkSimulator.app + + # --- Step 9: Upload and run tests on GPTDriver service. --- + - name: Run GPTDriver tests + run: | + # Ensure the script is executable + chmod +x ./branch-ios-sdk-repo/.github/gptdriverrunscript.sh + # Execute the script, passing the .app path and platform + bash ./branch-ios-sdk-repo/.github/gptdriverrunscript.sh ./ios-app-repo/build/Debug-iphonesimulator/BranchLinkSimulator.app ios + env: + API_ORG_KEY: ${{ secrets.MOBILEBOOST_API_ORG_KEY }} + API_KEY: ${{ secrets.MOBILEBOOST_API_ORG_KEY }} # As per vendor design + TEST_TAGS: Release \ No newline at end of file From 61de7a22e8599677a57d358a09ff661ec25e7975 Mon Sep 17 00:00:00 2001 From: NidhiDixit09 <93544270+NidhiDixit09@users.noreply.github.com> Date: Mon, 6 Oct 2025 21:01:06 -0700 Subject: [PATCH 02/10] Test Commit From e6ca94a8b7a8fd11e035627a864fc705c513baa5 Mon Sep 17 00:00:00 2001 From: NidhiDixit09 <93544270+NidhiDixit09@users.noreply.github.com> Date: Mon, 6 Oct 2025 21:05:16 -0700 Subject: [PATCH 03/10] Update gptdriverautomation.yaml --- .github/workflows/gptdriverautomation.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/gptdriverautomation.yaml b/.github/workflows/gptdriverautomation.yaml index 477a93899..e1e5b6c14 100644 --- a/.github/workflows/gptdriverautomation.yaml +++ b/.github/workflows/gptdriverautomation.yaml @@ -1,6 +1,7 @@ name: iOS Release Build and GPTDriver Tests on: + workflow_dispatch: push: branches: - 'Release-*' # Trigger for branches starting with "Release-" From 59509396062f6264025301e8d51445836b4c9598 Mon Sep 17 00:00:00 2001 From: NidhiDixit09 <93544270+NidhiDixit09@users.noreply.github.com> Date: Mon, 6 Oct 2025 21:11:46 -0700 Subject: [PATCH 04/10] Update gptdriverautomation.yaml --- .github/workflows/gptdriverautomation.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/gptdriverautomation.yaml b/.github/workflows/gptdriverautomation.yaml index e1e5b6c14..c16fec313 100644 --- a/.github/workflows/gptdriverautomation.yaml +++ b/.github/workflows/gptdriverautomation.yaml @@ -2,9 +2,7 @@ name: iOS Release Build and GPTDriver Tests on: workflow_dispatch: - push: - branches: - - 'Release-*' # Trigger for branches starting with "Release-" + inputs: jobs: BuildAndTestAppOnGPTDriver: # Job name, as chosen @@ -123,4 +121,4 @@ jobs: env: API_ORG_KEY: ${{ secrets.MOBILEBOOST_API_ORG_KEY }} API_KEY: ${{ secrets.MOBILEBOOST_API_ORG_KEY }} # As per vendor design - TEST_TAGS: Release \ No newline at end of file + TEST_TAGS: Release From 34269e0e1f70bb92bf95fd4e4f87ad7dd5c048c4 Mon Sep 17 00:00:00 2001 From: NidhiDixit09 <93544270+NidhiDixit09@users.noreply.github.com> Date: Mon, 6 Oct 2025 21:17:15 -0700 Subject: [PATCH 05/10] Update gptdriverautomation.yaml --- .github/workflows/gptdriverautomation.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/gptdriverautomation.yaml b/.github/workflows/gptdriverautomation.yaml index c16fec313..97cb093b7 100644 --- a/.github/workflows/gptdriverautomation.yaml +++ b/.github/workflows/gptdriverautomation.yaml @@ -1,5 +1,7 @@ name: iOS Release Build and GPTDriver Tests - +permissions: + contents: read + pull-requests: write on: workflow_dispatch: inputs: From 9dc156d49e60b7293894992fd6230f2158fb988e Mon Sep 17 00:00:00 2001 From: NidhiDixit09 <93544270+NidhiDixit09@users.noreply.github.com> Date: Mon, 6 Oct 2025 21:25:22 -0700 Subject: [PATCH 06/10] Update gptdriverautomation.yaml --- .github/workflows/gptdriverautomation.yaml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/gptdriverautomation.yaml b/.github/workflows/gptdriverautomation.yaml index 97cb093b7..d95098cd9 100644 --- a/.github/workflows/gptdriverautomation.yaml +++ b/.github/workflows/gptdriverautomation.yaml @@ -1,10 +1,6 @@ name: iOS Release Build and GPTDriver Tests -permissions: - contents: read - pull-requests: write -on: - workflow_dispatch: - inputs: + +on: workflow_dispatch jobs: BuildAndTestAppOnGPTDriver: # Job name, as chosen From 7a31f5045d6da78452190abb1e6b937dd7211b08 Mon Sep 17 00:00:00 2001 From: NidhiDixit09 <93544270+NidhiDixit09@users.noreply.github.com> Date: Mon, 6 Oct 2025 21:26:39 -0700 Subject: [PATCH 07/10] Updated extension. --- .../{gptdriverautomation.yaml => gptdriverautomation.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{gptdriverautomation.yaml => gptdriverautomation.yml} (100%) diff --git a/.github/workflows/gptdriverautomation.yaml b/.github/workflows/gptdriverautomation.yml similarity index 100% rename from .github/workflows/gptdriverautomation.yaml rename to .github/workflows/gptdriverautomation.yml From c45617503f0b09929a743f60b50c134698e9c363 Mon Sep 17 00:00:00 2001 From: NidhiDixit09 <93544270+NidhiDixit09@users.noreply.github.com> Date: Mon, 6 Oct 2025 21:29:56 -0700 Subject: [PATCH 08/10] Update gptdriverautomation.yml --- .github/workflows/gptdriverautomation.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gptdriverautomation.yml b/.github/workflows/gptdriverautomation.yml index d95098cd9..02ab907c3 100644 --- a/.github/workflows/gptdriverautomation.yml +++ b/.github/workflows/gptdriverautomation.yml @@ -1,6 +1,6 @@ name: iOS Release Build and GPTDriver Tests - -on: workflow_dispatch +on: + workflow_dispatch: {} jobs: BuildAndTestAppOnGPTDriver: # Job name, as chosen From 7668a1f69b4454caf85e0c2501b2dc8ace83c761 Mon Sep 17 00:00:00 2001 From: NidhiDixit09 <93544270+NidhiDixit09@users.noreply.github.com> Date: Mon, 6 Oct 2025 21:32:02 -0700 Subject: [PATCH 09/10] Update gptdriverautomation.yml --- .github/workflows/gptdriverautomation.yml | 119 +--------------------- 1 file changed, 5 insertions(+), 114 deletions(-) diff --git a/.github/workflows/gptdriverautomation.yml b/.github/workflows/gptdriverautomation.yml index 02ab907c3..b476e1cd8 100644 --- a/.github/workflows/gptdriverautomation.yml +++ b/.github/workflows/gptdriverautomation.yml @@ -3,120 +3,11 @@ on: workflow_dispatch: {} jobs: - BuildAndTestAppOnGPTDriver: # Job name, as chosen - runs-on: macos-latest # macOS runner is required for iOS builds + static-analysis: + runs-on: macos-latest steps: - # --- Step 1: Extract version from branch name --- - - name: Extract version from branch name - id: extract_version_step - run: | - BRANCH_NAME="${{ github.ref }}" - # Remove 'refs/heads/' prefix (e.g., refs/heads/Release-0.0.0 -> Release-0.0.0) - BRANCH_NAME_WITHOUT_PREFIX="${BRANCH_NAME#refs/heads/}" - # Extract version after "Release-" (e.g., Release-0.0.0 -> 0.0.0) - VERSION=$(echo "$BRANCH_NAME_WITHOUT_PREFIX" | sed -n 's/^Release-\([0-9]*\.[0-9]*\.[0-9]*\)$/\1/p') - - if [ -z "$VERSION" ]; then - echo "Error: Could not extract version from branch name '$BRANCH_NAME_WITHOUT_PREFIX'. Expected format: Release-X.Y.Z" - exit 1 - fi - - echo "Extracted versionName: $VERSION" - echo "VERSION_STRING=$VERSION" >> $GITHUB_ENV - - # Convert semantic version to an integer for CFBundleVersion (versionCode equivalent) - # Example: 1.2.3 -> 102003 (assuming max 2 digits for minor/patch) - # This should be adjusted based on the maximum expected values for major/minor/patch - MAJOR=$(echo "$VERSION" | cut -d. -f1) - MINOR=$(echo "$VERSION" | cut -d. -f2) - PATCH=$(echo "$VERSION" | cut -d. -f3) - - # Calculate versionCode (CFBundleVersion) - ensure this fits in a 32-bit integer - # Standard Android-like conversion: Major * 10000 + Minor * 100 + Patch - # This provides sufficient uniqueness for most common versioning schemes. - VERSION_CODE_INT=$(( MAJOR * 10000 + MINOR * 100 + PATCH )) - echo "Calculated versionCode: $VERSION_CODE_INT" - echo "VERSION_CODE_INT=$VERSION_CODE_INT" >> $GITHUB_ENV - - - # --- Step 2: Checkout the iOS Branch SDK repository --- - - name: Checkout BranchMetrics/ios-branch-deep-linking-attribution (SDK) + - name: Check out code uses: actions/checkout@v4 - with: - repository: BranchMetrics/ios-branch-deep-linking-attribution - ref: ${{ github.ref }} # Use the same branch that triggered the workflow - path: ./branch-ios-sdk-repo # Checkout into a subdirectory - - # --- Step 3: Build the iOS Branch SDK Framework --- - - name: Build Branch SDK Framework - run: | - # Build for simulator. Adjust scheme if necessary. - # The output framework will be in build/Debug-iphonesimulator/BranchSDK.framework - xcodebuild build -project Branch-SDK/Branch-SDK.xcodeproj \ - -scheme BranchSDK \ - -configuration Debug \ - -sdk iphonesimulator \ - BUILD_DIR="${{ github.workspace }}/branch-ios-sdk-repo/build" \ - SKIP_INSTALL=NO - working-directory: ./branch-ios-sdk-repo # Run xcodebuild from the SDK's checkout directory - - # --- Step 4: Checkout the iOS Branch Link Simulator App repository --- - - name: Checkout BranchMetrics/BranchLinkSimulator (App) - uses: actions/checkout@v4 - with: - repository: BranchMetrics/BranchLinkSimulator - ref: gptdriver/linkingTests # Checkout the specific app branch - path: ./ios-app-repo # Checkout into another subdirectory - - # --- Step 5: Copy the generated SDK Framework to the App's project --- - - name: Copy generated SDK Framework to App's libs directory - run: | - # Create a 'Frameworks' directory within the app repo for the local SDK - mkdir -p ./ios-app-repo/Frameworks - # Copy the built framework - cp -R ./branch-ios-sdk-repo/build/Debug-iphonesimulator/BranchSDK.framework ./ios-app-repo/Frameworks/ - working-directory: ${{ github.workspace }} # Run from the root of the GITHUB_WORKSPACE - - # --- Step 6: Build the iOS Branch Link Simulator App using the local SDK Framework --- - - name: Build iOS App with local SDK - run: | - # Build the app. Adjust project/workspace, scheme, and destination if necessary. - # We're passing MARKETING_VERSION (versionName) and CURRENT_PROJECT_VERSION (versionCode) - xcodebuild build -project BranchLinkSimulator.xcodeproj \ - -scheme BranchLinkSimulator \ - -configuration Debug \ - -sdk iphonesimulator \ - -destination 'platform=iOS Simulator,name=iPhone 15' \ - MARKETING_VERSION=${{ env.VERSION_STRING }} \ - CURRENT_PROJECT_VERSION=${{ env.VERSION_CODE_INT }} \ - # Adjust Framework Search Paths if your Xcode project doesn't automatically find it - # For example, if you need to point directly to the copied framework: - # FRAMEWORK_SEARCH_PATHS="$(SRCROOT)/Frameworks" - working-directory: ./ios-app-repo # Run xcodebuild from the App's checkout directory - - # --- Step 7: Echo the location of the generated .app bundle --- - - name: Echo .app bundle location - run: | - APP_PATH="./ios-app-repo/build/Debug-iphonesimulator/BranchLinkSimulator.app" - echo "Generated .app bundle location: $APP_PATH" - # You can also use 'find' to be more dynamic if the name might change - # find ./ios-app-repo/build -name "*.app" - - # --- Step 8: Upload Build Artifacts --- - - name: Upload Build Artifacts - uses: actions/upload-artifact@v4 - with: - name: BranchLinkSimulator-iOS-Debug-Build - path: ./ios-app-repo/build/Debug-iphonesimulator/BranchLinkSimulator.app - - # --- Step 9: Upload and run tests on GPTDriver service. --- - - name: Run GPTDriver tests + - name: Run static analysis run: | - # Ensure the script is executable - chmod +x ./branch-ios-sdk-repo/.github/gptdriverrunscript.sh - # Execute the script, passing the .app path and platform - bash ./branch-ios-sdk-repo/.github/gptdriverrunscript.sh ./ios-app-repo/build/Debug-iphonesimulator/BranchLinkSimulator.app ios - env: - API_ORG_KEY: ${{ secrets.MOBILEBOOST_API_ORG_KEY }} - API_KEY: ${{ secrets.MOBILEBOOST_API_ORG_KEY }} # As per vendor design - TEST_TAGS: Release + xcodebuild analyze -project BranchSDK.xcodeproj From 23fbea69a4facc453eb60bb584a4565c59f44359 Mon Sep 17 00:00:00 2001 From: NidhiDixit09 <93544270+NidhiDixit09@users.noreply.github.com> Date: Mon, 6 Oct 2025 22:31:30 -0700 Subject: [PATCH 10/10] Revert "Update gptdriverautomation.yml" This reverts commit 7668a1f69b4454caf85e0c2501b2dc8ace83c761. --- .github/workflows/gptdriverautomation.yml | 119 +++++++++++++++++++++- 1 file changed, 114 insertions(+), 5 deletions(-) diff --git a/.github/workflows/gptdriverautomation.yml b/.github/workflows/gptdriverautomation.yml index b476e1cd8..02ab907c3 100644 --- a/.github/workflows/gptdriverautomation.yml +++ b/.github/workflows/gptdriverautomation.yml @@ -3,11 +3,120 @@ on: workflow_dispatch: {} jobs: - static-analysis: - runs-on: macos-latest + BuildAndTestAppOnGPTDriver: # Job name, as chosen + runs-on: macos-latest # macOS runner is required for iOS builds steps: - - name: Check out code + # --- Step 1: Extract version from branch name --- + - name: Extract version from branch name + id: extract_version_step + run: | + BRANCH_NAME="${{ github.ref }}" + # Remove 'refs/heads/' prefix (e.g., refs/heads/Release-0.0.0 -> Release-0.0.0) + BRANCH_NAME_WITHOUT_PREFIX="${BRANCH_NAME#refs/heads/}" + # Extract version after "Release-" (e.g., Release-0.0.0 -> 0.0.0) + VERSION=$(echo "$BRANCH_NAME_WITHOUT_PREFIX" | sed -n 's/^Release-\([0-9]*\.[0-9]*\.[0-9]*\)$/\1/p') + + if [ -z "$VERSION" ]; then + echo "Error: Could not extract version from branch name '$BRANCH_NAME_WITHOUT_PREFIX'. Expected format: Release-X.Y.Z" + exit 1 + fi + + echo "Extracted versionName: $VERSION" + echo "VERSION_STRING=$VERSION" >> $GITHUB_ENV + + # Convert semantic version to an integer for CFBundleVersion (versionCode equivalent) + # Example: 1.2.3 -> 102003 (assuming max 2 digits for minor/patch) + # This should be adjusted based on the maximum expected values for major/minor/patch + MAJOR=$(echo "$VERSION" | cut -d. -f1) + MINOR=$(echo "$VERSION" | cut -d. -f2) + PATCH=$(echo "$VERSION" | cut -d. -f3) + + # Calculate versionCode (CFBundleVersion) - ensure this fits in a 32-bit integer + # Standard Android-like conversion: Major * 10000 + Minor * 100 + Patch + # This provides sufficient uniqueness for most common versioning schemes. + VERSION_CODE_INT=$(( MAJOR * 10000 + MINOR * 100 + PATCH )) + echo "Calculated versionCode: $VERSION_CODE_INT" + echo "VERSION_CODE_INT=$VERSION_CODE_INT" >> $GITHUB_ENV + + + # --- Step 2: Checkout the iOS Branch SDK repository --- + - name: Checkout BranchMetrics/ios-branch-deep-linking-attribution (SDK) uses: actions/checkout@v4 - - name: Run static analysis + with: + repository: BranchMetrics/ios-branch-deep-linking-attribution + ref: ${{ github.ref }} # Use the same branch that triggered the workflow + path: ./branch-ios-sdk-repo # Checkout into a subdirectory + + # --- Step 3: Build the iOS Branch SDK Framework --- + - name: Build Branch SDK Framework + run: | + # Build for simulator. Adjust scheme if necessary. + # The output framework will be in build/Debug-iphonesimulator/BranchSDK.framework + xcodebuild build -project Branch-SDK/Branch-SDK.xcodeproj \ + -scheme BranchSDK \ + -configuration Debug \ + -sdk iphonesimulator \ + BUILD_DIR="${{ github.workspace }}/branch-ios-sdk-repo/build" \ + SKIP_INSTALL=NO + working-directory: ./branch-ios-sdk-repo # Run xcodebuild from the SDK's checkout directory + + # --- Step 4: Checkout the iOS Branch Link Simulator App repository --- + - name: Checkout BranchMetrics/BranchLinkSimulator (App) + uses: actions/checkout@v4 + with: + repository: BranchMetrics/BranchLinkSimulator + ref: gptdriver/linkingTests # Checkout the specific app branch + path: ./ios-app-repo # Checkout into another subdirectory + + # --- Step 5: Copy the generated SDK Framework to the App's project --- + - name: Copy generated SDK Framework to App's libs directory + run: | + # Create a 'Frameworks' directory within the app repo for the local SDK + mkdir -p ./ios-app-repo/Frameworks + # Copy the built framework + cp -R ./branch-ios-sdk-repo/build/Debug-iphonesimulator/BranchSDK.framework ./ios-app-repo/Frameworks/ + working-directory: ${{ github.workspace }} # Run from the root of the GITHUB_WORKSPACE + + # --- Step 6: Build the iOS Branch Link Simulator App using the local SDK Framework --- + - name: Build iOS App with local SDK + run: | + # Build the app. Adjust project/workspace, scheme, and destination if necessary. + # We're passing MARKETING_VERSION (versionName) and CURRENT_PROJECT_VERSION (versionCode) + xcodebuild build -project BranchLinkSimulator.xcodeproj \ + -scheme BranchLinkSimulator \ + -configuration Debug \ + -sdk iphonesimulator \ + -destination 'platform=iOS Simulator,name=iPhone 15' \ + MARKETING_VERSION=${{ env.VERSION_STRING }} \ + CURRENT_PROJECT_VERSION=${{ env.VERSION_CODE_INT }} \ + # Adjust Framework Search Paths if your Xcode project doesn't automatically find it + # For example, if you need to point directly to the copied framework: + # FRAMEWORK_SEARCH_PATHS="$(SRCROOT)/Frameworks" + working-directory: ./ios-app-repo # Run xcodebuild from the App's checkout directory + + # --- Step 7: Echo the location of the generated .app bundle --- + - name: Echo .app bundle location + run: | + APP_PATH="./ios-app-repo/build/Debug-iphonesimulator/BranchLinkSimulator.app" + echo "Generated .app bundle location: $APP_PATH" + # You can also use 'find' to be more dynamic if the name might change + # find ./ios-app-repo/build -name "*.app" + + # --- Step 8: Upload Build Artifacts --- + - name: Upload Build Artifacts + uses: actions/upload-artifact@v4 + with: + name: BranchLinkSimulator-iOS-Debug-Build + path: ./ios-app-repo/build/Debug-iphonesimulator/BranchLinkSimulator.app + + # --- Step 9: Upload and run tests on GPTDriver service. --- + - name: Run GPTDriver tests run: | - xcodebuild analyze -project BranchSDK.xcodeproj + # Ensure the script is executable + chmod +x ./branch-ios-sdk-repo/.github/gptdriverrunscript.sh + # Execute the script, passing the .app path and platform + bash ./branch-ios-sdk-repo/.github/gptdriverrunscript.sh ./ios-app-repo/build/Debug-iphonesimulator/BranchLinkSimulator.app ios + env: + API_ORG_KEY: ${{ secrets.MOBILEBOOST_API_ORG_KEY }} + API_KEY: ${{ secrets.MOBILEBOOST_API_ORG_KEY }} # As per vendor design + TEST_TAGS: Release