Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 6 additions & 2 deletions .github/actions/yarn-install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,9 @@ runs:
cache-dependency-path: yarn.lock

- name: Install dependencies
shell: bash
run: yarn install --immutable
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
max_attempts: 3
retry_wait_seconds: 5
command: yarn install --immutable
23 changes: 16 additions & 7 deletions .github/workflows/mobile-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -309,12 +309,14 @@ jobs:
bundle install --jobs 4 --retry 3
working-directory: ./app
- name: Install iOS Dependencies
run: |
echo "Installing iOS dependencies..."
cd ios
# Reuse the same guarded flow as local to ensure reproducibility
bundle exec bash scripts/pod-install-with-cache-fix.sh
working-directory: ./app
uses: nick-fields/retry@v3
with:
timeout_minutes: 20
max_attempts: 3
retry_wait_seconds: 10
command: |
cd app/ios
bundle exec bash scripts/pod-install-with-cache-fix.sh
env:
SELFXYZ_INTERNAL_REPO_PAT: ${{ secrets.SELFXYZ_INTERNAL_REPO_PAT }}
- name: Resolve iOS workspace
Expand Down Expand Up @@ -436,12 +438,19 @@ jobs:
with:
accept-android-sdk-licenses: true
- name: Cache NDK
id: ndk-cache
uses: actions/cache@v4
with:
path: ${{ env.ANDROID_HOME }}/ndk/${{ env.ANDROID_NDK_VERSION }}
key: ${{ runner.os }}-ndk-${{ env.ANDROID_NDK_VERSION }}
- name: Install NDK
run: sdkmanager "ndk;${{ env.ANDROID_NDK_VERSION }}"
if: steps.ndk-cache.outputs.cache-hit != 'true'
uses: nick-fields/retry@v3
with:
timeout_minutes: 15
max_attempts: 3
retry_wait_seconds: 10
command: sdkmanager "ndk;${{ env.ANDROID_NDK_VERSION }}"
Comment on lines +441 to +453
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Inconsistent NDK retry configuration across workflows.

This file uses max_attempts: 3 for NDK installation (line 451), while mobile-deploy.yml (line 1065) uses max_attempts: 5. Standardize retry parameters across workflows unless deployment context justifies higher retry count.

Consider standardizing NDK retry attempts to 3 or 5 consistently, or add a comment explaining why deployment workflows need more retries.

🤖 Prompt for AI Agents
In .github/workflows/mobile-ci.yml around lines 441 to 453 the NDK install step
uses retry configuration max_attempts: 3 which is inconsistent with
mobile-deploy.yml (max_attempts: 5); update this workflow to use the same retry
count as mobile-deploy.yml (or change both to the chosen standard) and/or add a
terse comment explaining why the deploy workflow needs a different retry count
(if it does), ensuring both files use the agreed value and consistent retry
settings.

- name: Install Mobile Dependencies
uses: ./.github/actions/yarn-install
- name: Cache Built Dependencies
Expand Down
60 changes: 16 additions & 44 deletions .github/workflows/mobile-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1057,51 +1057,23 @@ jobs:
with:
accept-android-sdk-licenses: true

- name: Install NDK and CMake
- name: Install NDK
if: inputs.platform != 'ios' && steps.ndk-cache.outputs.cache-hit != 'true'
run: |
max_attempts=5
attempt=1

# Install NDK
while [ $attempt -le $max_attempts ]; do
echo "Attempt $attempt of $max_attempts to install NDK..."
if sdkmanager "ndk;${{ env.ANDROID_NDK_VERSION }}"; then
echo "Successfully installed NDK"
break
fi
echo "Failed to install NDK on attempt $attempt"
if [ $attempt -eq $max_attempts ]; then
echo "All attempts to install NDK failed"
exit 1
fi
# Exponential backoff: 2^attempt seconds
wait_time=$((2 ** attempt))
echo "Waiting $wait_time seconds before retrying..."
sleep $wait_time
attempt=$((attempt + 1))
done

# Install CMake (required for native module builds)
echo "Installing CMake..."
attempt=1
while [ $attempt -le $max_attempts ]; do
echo "Attempt $attempt of $max_attempts to install CMake..."
if sdkmanager "cmake;3.22.1"; then
echo "Successfully installed CMake"
break
fi
echo "Failed to install CMake on attempt $attempt"
if [ $attempt -eq $max_attempts ]; then
echo "All attempts to install CMake failed"
exit 1
fi
# Exponential backoff: 2^attempt seconds
wait_time=$((2 ** attempt))
echo "Waiting $wait_time seconds before retrying..."
sleep $wait_time
attempt=$((attempt + 1))
done
uses: nick-fields/retry@v3
with:
timeout_minutes: 15
max_attempts: 5
retry_wait_seconds: 10
command: sdkmanager "ndk;${{ env.ANDROID_NDK_VERSION }}"

- name: Install CMake
if: inputs.platform != 'ios' && steps.ndk-cache.outputs.cache-hit != 'true'
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
max_attempts: 5
retry_wait_seconds: 10
command: sdkmanager "cmake;3.22.1"

- name: Set Gradle JVM options
if: inputs.platform != 'ios' # Apply to CI builds (not just ACT)
Expand Down
56 changes: 45 additions & 11 deletions .github/workflows/mobile-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,22 @@ jobs:
run: echo "YARN_ENABLE_HARDENED_MODE=0" >> $GITHUB_ENV
- name: Install deps (internal PRs and protected branches)
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false }}
run: yarn install --immutable --silent
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
max_attempts: 3
retry_wait_seconds: 5
command: yarn install --immutable --silent
env:
SELFXYZ_INTERNAL_REPO_PAT: ${{ secrets.SELFXYZ_INTERNAL_REPO_PAT }}
- name: Install deps (forked PRs - no secrets)
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == true }}
run: yarn install --immutable --silent
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
max_attempts: 3
retry_wait_seconds: 5
command: yarn install --immutable --silent
- name: Validate Maestro test file
if: false # Skip for build-only test - keep logic for future E2E
run: |
Expand Down Expand Up @@ -106,7 +116,12 @@ jobs:
with:
accept-android-sdk-licenses: true
- name: Install NDK
run: sdkmanager "ndk;${{ env.ANDROID_NDK_VERSION }}"
uses: nick-fields/retry@v3
with:
timeout_minutes: 15
max_attempts: 3
retry_wait_seconds: 10
command: sdkmanager "ndk;${{ env.ANDROID_NDK_VERSION }}"
- name: Build dependencies (outside emulator)
run: |
echo "Building dependencies..."
Expand Down Expand Up @@ -229,12 +244,22 @@ jobs:
run: echo "YARN_ENABLE_HARDENED_MODE=0" >> $GITHUB_ENV
- name: Install deps (internal PRs and protected branches)
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false }}
run: yarn install --immutable --silent
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
max_attempts: 3
retry_wait_seconds: 5
command: yarn install --immutable --silent
env:
SELFXYZ_INTERNAL_REPO_PAT: ${{ secrets.SELFXYZ_INTERNAL_REPO_PAT }}
- name: Install deps (forked PRs - no secrets)
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == true }}
run: yarn install --immutable --silent
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
max_attempts: 3
retry_wait_seconds: 5
command: yarn install --immutable --silent
- name: Validate Maestro test file
run: |
[ -f app/tests/e2e/launch.ios.flow.yaml ] || { echo "❌ iOS E2E test file missing"; exit 1; }
Expand All @@ -246,7 +271,12 @@ jobs:
key: ${{ runner.os }}-maestro-${{ env.MAESTRO_VERSION }}
- name: Install Maestro
if: steps.cache-maestro.outputs.cache-hit != 'true'
run: curl -Ls "https://get.maestro.mobile.dev" | bash
uses: nick-fields/retry@v3
with:
timeout_minutes: 5
max_attempts: 3
retry_wait_seconds: 10
command: curl -Ls "https://get.maestro.mobile.dev" | bash
- name: Add Maestro to path
run: echo "$HOME/.maestro/bin" >> "$GITHUB_PATH"
- name: Set up Xcode
Expand Down Expand Up @@ -304,11 +334,15 @@ jobs:
yarn workspace @selfxyz/mobile-app run build:deps || { echo "❌ Dependency build failed"; exit 1; }
echo "✅ Dependencies built successfully"
- name: Install iOS dependencies
run: |
echo "Installing iOS dependencies..."
cd app/ios
echo "📦 Installing pods via centralized script…"
BUNDLE_GEMFILE=../Gemfile bundle exec bash scripts/pod-install-with-cache-fix.sh || { echo "❌ Pod install failed"; exit 1; }
uses: nick-fields/retry@v3
with:
timeout_minutes: 20
max_attempts: 3
retry_wait_seconds: 10
command: |
cd app/ios
echo "📦 Installing pods via centralized script…"
BUNDLE_GEMFILE=../Gemfile bundle exec bash scripts/pod-install-with-cache-fix.sh
env:
SELFXYZ_INTERNAL_REPO_PAT: ${{ secrets.SELFXYZ_INTERNAL_REPO_PAT }}
- name: Setup iOS Simulator
Expand Down
62 changes: 48 additions & 14 deletions .github/workflows/mobile-sdk-demo-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,22 @@ jobs:
run: echo "YARN_ENABLE_HARDENED_MODE=0" >> $GITHUB_ENV
- name: Install deps (internal PRs and protected branches)
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false }}
run: yarn install --immutable --silent
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
max_attempts: 3
retry_wait_seconds: 5
command: yarn install --immutable --silent
env:
SELFXYZ_INTERNAL_REPO_PAT: ${{ secrets.SELFXYZ_INTERNAL_REPO_PAT }}
- name: Install deps (forked PRs - no secrets)
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == true }}
run: yarn install --immutable --silent
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
max_attempts: 3
retry_wait_seconds: 5
command: yarn install --immutable --silent
- name: Validate Maestro test file
if: false # Skip for build-only test - keep logic for future E2E
run: |
Expand Down Expand Up @@ -108,7 +118,12 @@ jobs:
with:
accept-android-sdk-licenses: true
- name: Install NDK
run: sdkmanager "ndk;${{ env.ANDROID_NDK_VERSION }}"
uses: nick-fields/retry@v3
with:
timeout_minutes: 15
max_attempts: 3
retry_wait_seconds: 10
command: sdkmanager "ndk;${{ env.ANDROID_NDK_VERSION }}"
- name: Enable KVM group perms
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
Expand Down Expand Up @@ -216,12 +231,22 @@ jobs:
run: echo "YARN_ENABLE_HARDENED_MODE=0" >> $GITHUB_ENV
- name: Install deps (internal PRs and protected branches)
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false }}
run: yarn install --immutable --silent
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
max_attempts: 3
retry_wait_seconds: 5
command: yarn install --immutable --silent
env:
SELFXYZ_INTERNAL_REPO_PAT: ${{ secrets.SELFXYZ_INTERNAL_REPO_PAT }}
- name: Install deps (forked PRs - no secrets)
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == true }}
run: yarn install --immutable --silent
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
max_attempts: 3
retry_wait_seconds: 5
command: yarn install --immutable --silent
- name: Validate Maestro test file
run: |
[ -f packages/mobile-sdk-demo/tests/e2e/launch.ios.flow.yaml ] || { echo "❌ iOS E2E test file missing"; exit 1; }
Expand All @@ -233,7 +258,12 @@ jobs:
key: ${{ runner.os }}-maestro-${{ env.MAESTRO_VERSION }}
- name: Install Maestro
if: steps.cache-maestro.outputs.cache-hit != 'true'
run: curl -Ls "https://get.maestro.mobile.dev" | bash
uses: nick-fields/retry@v3
with:
timeout_minutes: 5
max_attempts: 3
retry_wait_seconds: 10
command: curl -Ls "https://get.maestro.mobile.dev" | bash
- name: Add Maestro to path
run: echo "$HOME/.maestro/bin" >> "$GITHUB_PATH"
- name: Set up Xcode
Expand Down Expand Up @@ -284,17 +314,21 @@ jobs:
yarn workspace mobile-sdk-demo run prebuild || { echo "❌ Dependency build failed"; exit 1; }
echo "✅ Dependencies built successfully"
- name: Install iOS dependencies
uses: nick-fields/retry@v3
with:
timeout_minutes: 20
max_attempts: 3
retry_wait_seconds: 10
command: |
if [ -n "${SELFXYZ_INTERNAL_REPO_PAT}" ]; then
echo "🔑 Using SELFXYZ_INTERNAL_REPO_PAT for private pod access"
echo "::add-mask::${SELFXYZ_INTERNAL_REPO_PAT}"
fi
cd packages/mobile-sdk-demo/ios
pod install
env:
SELFXYZ_INTERNAL_REPO_PAT: ${{ secrets.SELFXYZ_INTERNAL_REPO_PAT }}
GIT_TERMINAL_PROMPT: 0
Comment on lines +317 to 331
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Use consistent pod installation script across workflows.

This file uses direct pod install (line 328), while mobile-ci.yml and mobile-e2e.yml invoke scripts/pod-install-with-cache-fix.sh. If this script contains important workarounds or fixes, the SDK demo should use it too. If not, document why the demo uses a simpler approach.

Align the pod install approach:

Option A: Use the centralized script (recommended for consistency):

  command: |
    if [ -n "${SELFXYZ_INTERNAL_REPO_PAT}" ]; then
      echo "🔑 Using SELFXYZ_INTERNAL_REPO_PAT for private pod access"
      echo "::add-mask::${SELFXYZ_INTERNAL_REPO_PAT}"
    fi
    cd packages/mobile-sdk-demo/ios
-   pod install
+   bundle exec bash ../../app/scripts/pod-install-with-cache-fix.sh

Option B: Or document why the demo uses direct pod install in a comment.

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
.github/workflows/mobile-sdk-demo-e2e.yml around lines 317 to 331: the workflow
runs a direct `pod install` in packages/mobile-sdk-demo/ios which differs from
other workflows that call scripts/pod-install-with-cache-fix.sh; update the
workflow to call the centralized script for consistency and to pick up any
cache/fix workarounds (replace the `pod install` line with a call to
scripts/pod-install-with-cache-fix.sh and ensure the script is executable and
run from repo root), or if you intentionally want the simpler install, add a
short inline comment above the command explaining why the centralized script is
not used and confirm there are no required workarounds missing.

run: |
echo "Installing iOS dependencies..."
if [ -n "${SELFXYZ_INTERNAL_REPO_PAT}" ]; then
echo "🔑 Using SELFXYZ_INTERNAL_REPO_PAT for private pod access"
echo "::add-mask::${SELFXYZ_INTERNAL_REPO_PAT}"
fi
cd packages/mobile-sdk-demo/ios
pod install
- name: Setup iOS Simulator
run: |
echo "Setting up iOS Simulator..."
Expand Down
Loading