Skip to content

PPP Mobile App — CI/CD ​

Workflows ​

mobile-ci.yml — CI Gate (Lint + Type-check + Tests) ​

Trigger: Push/PR to main/uat when mobile paths change, or manual dispatch.

TierJobWhat it does
1lintpnpm lint (ESLint via expo) + pnpm typecheck (tsc --noEmit)
2testpnpm test:ci (Jest with coverage) + Codecov upload

Tier 2 only runs if Tier 1 passes (needs: [lint]).

Coverage: Thresholds configured in package.json (coverageThreshold). Coverage summary posted to GitHub Actions step summary. Uploaded to Codecov with mobile-ppp flag.

Issues: #641, #643


mobile-build-dev.yml — Legacy EAS Cloud Build (deprecated) ​

Deprecated: Use mobile-build-native.yml instead. This workflow used EAS cloud builds which are slower and less reliable than native GitHub Actions builds.

Issues: #645, #1648


mobile-build-native.yml — Native Build & Deploy (primary, owns store submission) ​

This is the workflow that actually delivers a build to TestFlight / Play Store. It builds natively (no EAS cloud) and, when submit: true, immediately submits the same run's build via Fastlane's upload_testflight (pilot) lane (iOS → TestFlight) and r0adkll/upload-google-play (Android → Play Store). The iOS submit step used to run xcrun altool; that was replaced with the Fastlane lane after Xcode 26 broke altool's legacy --upload-package flag syntax (#9945) — see the "Submit IPA to TestFlight via fastlane" step's own header comment for the full story. A separate mobile-distribute.yml workflow previously claimed to own this (its name literally said "Distribute"), but never had a single successful run in its history and was removed (#11007) — see the CD section immediately below for how a build actually gets here.

Trigger: workflow_dispatch (manual, submit input defaults true) or workflow_call from mobile-cd.yml, which invokes it automatically once daily (schedule) when mobile/ppp/** has changed since the last successful deploy, or unconditionally (any time, subject to the shared mobile-cd-* concurrency group queueing behind an in-progress run) on mobile-cd.yml's own workflow_dispatch (#11149 — see the CD section immediately below).

Inputs:

InputTypeDefaultDescription
platformchoiceallall / ios / android
profilechoicedevelopmentdevelopment / preview / production
submitbooleantrueSubmit to stores after build

Jobs:

  1. build-ios — Builds on a GitHub-hosted macos-15 runner using Xcode (xcodebuild archive + exportArchive) — no self-hosted Mac mini required
  2. build-android — Builds on ubuntu-latest using Gradle (bundleRelease + assembleRelease)
  3. close-success / report-failure — Auto-manages GitHub issues

Artifacts:

  • android-aab-development — AAB for Google Play submission
  • android-apk-development — APK for emulator/device testing (#1817)
  • ios-ipa-development — IPA for TestFlight
  • ios-dsyms-development — dSYMs for manual crash symbolication, 30-day retention (#11000)
  • android-symbols-development — unstripped native .so libraries + R8 mapping when present, 30-day retention (#11000)

Symbol retention (#11000): the ios-dsyms-* artifact makes any .ips crash report symbolicatable with only repo access — no SENTRY_AUTH_TOKEN, which nobody has outside CI. CI proves the artifact matches what shipped: it reads the exported IPA's LC_UUIDs with dwarfdump -u and fails the job before the TestFlight submit if any is missing from the archived dSYMs. This is additive to the #10831 gate below, which is unchanged. See the Symbolication Runbook.

dSYM / symbolication release gate (#10831): for release/TestFlight builds (inputs.submit == true), the build-ios job hard-gates on three sequential steps — dSYM upload to Sentry, local dSYM validity check, and a post-upload smoke-check that confirms the build's dSYM UUIDs are actually resolvable via the live Sentry API (GET /projects/{org}/{project}/files/dsyms/). None of the three is continue-on-error — a failure fails the job and the build does not ship. See the Symbolication Runbook for what to do when this gate fails.

Issues: #2880, #10831


mobile-cd.yml — Automated Trigger for mobile-build-native.yml ​

This is how a build reaches a device without anyone manually dispatching anything. Once daily (schedule, not push — see below), it resolves the branch → EAS-style profile mapping (uat → preview; anything else → production, though production pushes are currently disabled pending go-live, #4537) and calls mobile-build-native.yml with submit: true — the same build-and-submit run described above, just triggered by the schedule instead of a manual dispatch.

Trigger (#11149): a daily schedule — cron: '0 20 * * *' (20:00 UTC = 21:00 BST/UTC+1, Matt's requested 9pm cadence; fixed offset, not DST-adjusted) — or manual workflow_dispatch (environment + platform inputs), which is the unconditional urgent-fix override. Previously this fired on every push to uat that touched mobile/ppp/**, which queued a fresh TestFlight/Play Store internal build several times a day whenever multiple mobile PRs merged — disrupting Matt's in-flight manual testing (an update mid-test looks identical to a glitch). Mirrors cd.yml's push-trigger-removed + daily-schedule pattern (#9994): a detect-changes job diffs against the last mobile-cd run that actually published an APK (not last push, and not merely last successful run — a run whose build job was skipped still concludes success, so the baseline only advances onto one that shipped android-apk-preview, via detect-changes-baseline.mjs's requireArtifact option, #11493), so a scheduled run with nothing new in mobile/ppp/** skips the native build job entirely — the schedule doesn't reintroduce push-per-merge churn under a different trigger. workflow_dispatch bypasses detect-changes and always runs.

Issues: #4404, #11149


mobile-e2e.yml — Maestro E2E Tests ​

Trigger: Daily 6 AM UTC schedule (0 6 * * *) + manual workflow_dispatch.

Inputs (manual dispatch only):

InputTypeDefaultDescription
platformchoiceandroidandroid / ios / both
flowstring(blank)Specific flow YAML to run (blank = all flows)

Jobs:

JobRunnerWhat it does
android-e2eubuntu-latestBoot Android emulator, download latest dev APK from native build artifacts, run Maestro flows
ios-e2emacos-latestBoot iOS simulator, download latest dev .app from native build artifacts, run Maestro flows
reportubuntu-latestAuto-create GitHub issue on failure; auto-close on recovery

Schedule behaviour: The daily cron runs Android only. iOS is only triggered via manual dispatch with platform: ios or platform: both (macOS runners are expensive).

Maestro flows (in mobile/ppp/e2e/):

  • login.yaml -- app launch, Cognito sign-in, dashboard visible
  • logbook-entry.yaml -- navigate to Surgical Logbook, add procedure, verify in list
  • timesheet-entry.yaml -- navigate to Timesheet, create entry, verify saved
  • wellness-entry.yaml -- navigate to Wellness, complete questionnaire, verify score

Auto-issue management: Uses a dedicated mobile-e2e-failure label. On failure, creates or comments on an open issue. On recovery, adds a "Resolved" comment and closes the issue (mirrors e2e.yml pattern).

Build prerequisite: The workflow downloads the latest development APK from mobile-build-native.yml artifacts. If no build exists, trigger a build first via the mobile-build-native.yml workflow.

Secrets required: E2E_TEST_EMAIL, E2E_TEST_PASSWORD (see secrets table below).

Issues: #651


mobile-store-listing.yml -- Store Listing Sync ​

Trigger: Manual workflow_dispatch + push to main/uat when metadata files change.

Inputs (manual dispatch only):

InputTypeDefaultDescription
platformchoiceallall / ios / android
dry_runbooleantruePreview changes without applying
whats_new_onlybooleanfalseOnly sync release notes (iOS only)

Jobs:

JobRunnerWhat it does
validateubuntu-latestValidates metadata files (character limits, required fields)
sync-iosmacos-latestSyncs iOS metadata to App Store Connect via Fastlane deliver or ASC API
sync-androidubuntu-latestSyncs Android metadata to Google Play via Publishing API (Node.js script)

Push behaviour: Metadata file changes on main/uat trigger a dry run automatically. Manual dispatch with dry_run = false is required to apply changes.

Android sync uses the Google Play Publishing API directly (edits.listings, edits.tracks) via scripts/google-play-metadata-sync.mjs. This provides atomic metadata updates (create edit, modify, commit/rollback) without requiring Fastlane/Ruby.

Country targeting: Configured in store-config/distribution.json and applied via the --set-country-targeting flag. Currently targets GB and AU with restOfWorld: false.

Metadata paths: mobile/ppp/fastlane/metadata/android/{locale}/ for Android, mobile/ppp/fastlane/metadata/ios/{locale}/ for iOS.

Secrets required: GOOGLE_PLAY_JSON_KEY, APP_STORE_CONNECT_API_KEY_ID, APP_STORE_CONNECT_API_KEY_ISSUER_ID, APP_STORE_CONNECT_API_KEY_CONTENT.

Issues: #1993, #1994


Standardised Path Filters ​

All mobile CI workflows use a consistent set of path filters (documented per #1233):

yaml
paths:
  # Include
  - 'mobile/ppp/**' # Mobile app source
  - 'packages-shared/ppp/**' # Shared schemas used by mobile
  - 'packages/core-constants/**' # Shared constants

  # Exclude (non-code changes)
  - '!mobile/ppp/**/*.md' # Markdown files
  - '!mobile/ppp/docs/**' # Documentation directory
  - '!mobile/ppp/memory-bank/**' # Memory bank (dev tooling)
  - '!mobile/ppp/.cursorrules' # Editor config

Rationale:

  • Changes to packages-shared/ppp/** or packages/core-constants/** may affect mobile app behavior, so they trigger mobile CI
  • Documentation-only changes do not trigger CI (saves runner minutes)
  • The mobile-build-dev.yml and mobile-e2e.yml workflows use manual/scheduled triggers only, so path filters are not applicable

Required GitHub Actions Secrets ​

All secrets below are Pulumi-managed via api/infra-github/ (the ppp-github stack). The source of truth is Doppler ppp/dev (renamed from ppp/share per #5171 — this doc previously still said ppp/share, corrected in #9930). Run cd api/infra-github && pnpm up to sync any Doppler change to GitHub Actions automatically. Do not set these manually in GitHub repo settings — Pulumi will overwrite them on the next pulumi up. See #2865.

WEB_URL/TRPC_URL per environment are not GitHub secrets — mobile-build-native.yml hardcodes both UAT and production URLs as literals keyed off APP_VARIANT (see the WEB_URL/TRPC_URL env: lines in that workflow). UAT_WEB_URL, UAT_TRPC_URL, PROD_WEB_URL, PROD_TRPC_URL and a mobile-build-prod.yml consumer were previously listed below as if live — mobile-build-prod.yml never existed and mobile-build-dev.yml is the now-deprecated legacy EAS workflow above; mobile-build-native.yml is the sole build workflow today and none of the four URL secrets are referenced by any workflow (#9930 audit — removed from this table).

SecretDescriptionUsed byDoppler key
APPLE_ASC_KEY_P8Base64-encoded App Store Connect API key .p8 file contentsmobile-build-native.ymlAPPLE_ASC_KEY_P8
APPLE_ASC_KEY_IDApp Store Connect API Key ID (e.g. 3YLJ5AQ8TZ)mobile-build-native.ymlAPPLE_ASC_KEY_ID
APPLE_ASC_ISSUER_IDApp Store Connect API Issuer ID (UUID)mobile-build-native.ymlAPPLE_ASC_ISSUER_ID
APPLE_TEAM_IDApple Developer Team ID (e.g. 9T8B78M6P3)mobile-build-native.ymlAPPLE_TEAM_ID
IOS_DIST_CERT_P12_BASE64Combined distribution certificate + private key (P12), base64-encodedmobile-build-native.ymlIOS_DIST_CERT_P12_BASE64
IOS_DIST_CERT_PASSWORDExport password for the P12 abovemobile-build-native.ymlIOS_DIST_CERT_PASSWORD
IOS_PROVISIONING_PROFILE_BASE64App Store provisioning profile for com.professionalperformanceportfolio.ppp, base64-encodedmobile-build-native.ymlIOS_PROVISIONING_PROFILE_BASE64
APPLE_PROD_ASC_APP_IDNumeric App Store Connect app ID for bundle com.professionalperformanceportfolio.ppp (find in App Store Connect → App Information → Apple ID)mobile-build-native.ymlAPPLE_PROD_ASC_APP_ID
APP_STORE_CONNECT_API_KEY_IDASC API Key ID for Fastlane distribution — aliased to APPLE_ASC_KEY_ID (same credential, Fastlane-specific secret name; no separate Doppler entry, #9930)mobile-store-listing.ymlAPPLE_ASC_KEY_ID
APP_STORE_CONNECT_API_KEY_ISSUER_IDASC API Issuer ID for Fastlane distribution — aliased to APPLE_ASC_ISSUER_ID (#9930)mobile-store-listing.ymlAPPLE_ASC_ISSUER_ID
APP_STORE_CONNECT_API_KEY_CONTENTBase64-encoded .p8 key content for Fastlane distribution — aliased to APPLE_ASC_KEY_P8 (#9930)mobile-store-listing.ymlAPPLE_ASC_KEY_P8
GOOGLE_PLAY_SERVICE_ACCOUNT_KEYBase64-encoded Google Play service account JSON key (must have Google Play Developer API enabled and Google Play Android Developer role on package com.professionalperformanceportfolio.ppp)mobile-build-native.yml, mobile-store-listing.yml (base64-decoded at point of use — see below)GOOGLE_PLAY_SERVICE_ACCOUNT_KEY
CODECOV_TOKENCodecov upload tokenmobile-ci.ymlCODECOV_TOKEN
E2E_TEST_EMAILTest account email for Maestro E2E flowsmobile-e2e.ymlE2E_TEST_EMAIL
E2E_TEST_PASSWORDTest account password for Maestro E2E flowsmobile-e2e.yml, bdd-uat.yml, mobile-web-bdd.yml, cd.ymlE2E_TEST_PASSWORD
TEST_ACCOUNT_PASSWORDShared QA seed-account password (#4385), despite the historical "UAT" framing this is the same ppp/dev config as everything else in this table (#9930)cd.yml ("Seed UAT test accounts" step)TEST_ACCOUNT_PASSWORD

GOOGLE_PLAY_JSON_KEY is not a GitHub secret, and the two consumers below decode GOOGLE_PLAY_SERVICE_ACCOUNT_KEY (base64, to match the EAS/Gradle build secret) into the raw JSON it holds by two different mechanisms — they are not interchangeable:

  • mobile-build-native.yml's "Write and validate store credentials" step base64-decodes the secret straight to a file (credentials/google-play-service-account.json), which is passed directly to r0adkll/upload-google-play's serviceAccountJson: file-path input. No GOOGLE_PLAY_JSON_KEY env var is created in this path.
  • mobile-store-listing.yml's "Decode Google Play service account key" step base64-decodes the secret into a masked GOOGLE_PLAY_JSON_KEY env var, which is what google-play-metadata-sync.mjs and Fastlane's json_key_data actually read.

Before #9930 both mobile-store-listing.yml and (the now-removed, #11007) mobile-distribute.yml fed the base64 value straight through under the GOOGLE_PLAY_JSON_KEY name, which failed on every run (GOOGLE_PLAY_JSON_KEY is not valid JSON) — mobile-store-listing.yml's Android job had been red since at least 2026-03-25.

How Secrets Flow into Builds ​

Doppler (ppp/dev)
    │
    ▼  doppler run (api/infra-github/scripts/run.sh)
  Pulumi (api/infra-github)
    │  @pulumi/github ActionsSecret (idempotent upsert)
    ▼
  GitHub Actions secrets
    │
    ▼  workflow env: block
  Gradle / Xcode / Fastlane / Jest
    │
    ▼
  app.config.js → expo.extra → Constants.expoConfig.extra
  1. Doppler ppp/dev is the single source of truth for all mobile CI secrets (renamed from ppp/share per #5171)
  2. cd api/infra-github && pnpm up syncs Doppler values → GitHub Actions secrets via Pulumi
  3. GitHub Actions secrets are mapped to environment variables in the workflow env: block
  4. Gradle/Xcode picks up environment variables during native build (via expo prebuild + app.config.js)
  5. mobile-build-native.yml sets WEB_URL/TRPC_URL as hardcoded per-APP_VARIANT literals (not Doppler secrets — see above), and app.config.js reads process.env.WEB_URL / process.env.TRPC_URL into expo.extra
  6. The app accesses these at runtime via Constants.expoConfig.extra

Adding a New Secret ​

  1. Add the secret value to Doppler: doppler secrets set MY_SECRET --project ppp --config dev
  2. Add a repoSecret('MY_SECRET', requireEnvSecret('MY_SECRET')) call in api/infra-github/src/index.ts
  3. Run cd api/infra-github && pnpm up — Pulumi will create the secret in GitHub Actions
  4. Reference ${{ secrets.MY_SECRET }} in the relevant workflow

Setup Instructions (first-time bootstrap) ​

  1. Create a fine-grained GitHub PAT with secrets: write scope on this repository. Store it in Doppler as PULUMI_GITHUB_TOKEN under ppp/dev.

  2. Install dependencies: cd api/infra-github && pnpm install

  3. Log in to Pulumi state backend (shared with infra-azure):

    bash
    bash api/infra-github/scripts/run.sh -- login azblob://pulumi-state
  4. Preview changes:

    bash
    cd api/infra-github && pnpm preview
  5. Apply secrets (creates/updates all secrets in GitHub Actions):

    bash
    cd api/infra-github && pnpm up

Verify secret scoping ​

  • All secrets are repository-level (not environment-level) so they are available to all workflows

Signing Credentials ​

Apple and Android signing credentials are stored as GitHub Actions secrets and managed via Doppler/Pulumi (see above).

iOS (used by mobile-build-native.yml):

  • IOS_DIST_CERT_P12_BASE64 — Combined distribution certificate + private key (P12)
  • IOS_DIST_CERT_PASSWORD — Password for the P12 file
  • IOS_PROVISIONING_PROFILE_BASE64 — Development/preview provisioning profile
  • APPLE_ASC_KEY_P8 — App Store Connect API key for TestFlight submission

Android (used by mobile-build-native.yml):

  • ANDROID_KEYSTORE_BASE64 — Release keystore (base64-encoded)
  • ANDROID_KEYSTORE_PASSWORD, ANDROID_KEY_ALIAS, ANDROID_KEY_PASSWORD — Keystore credentials
  • GOOGLE_PLAY_SERVICE_ACCOUNT_KEY — Google Play API access for store submission

The credentials/ directory is gitignored. See #2880 for native build setup and #1672 for App Store Connect API Key configuration.

Security Notes ​

  • Secrets are never printed in workflow logs (GitHub automatically masks them)
  • app.config.js must never contain hardcoded secret values
  • WEB_URL and TRPC_URL are injected at build time only, not committed to source

App Store Connect Details (Development) ​

FieldValue
NamePPP (Development)
Bundle IDcom.professionalperformanceportfolio.ppp.development
SKUEX1736765541823
Apple ID / ASC App ID6740482813

Monorepo Package Manager Note ​

The mobile directory uses pnpm (>= 9), aligned with the rest of the monorepo. Mobile CI jobs use pnpm/action-setup@v4 and reference mobile/ppp/pnpm-lock.yaml.


Troubleshooting: Google Play API Credentials ​

If Android submission fails with a credentials error, check the following:

1. Service account setup in Google Cloud Console ​

2. Service account permissions in Google Play Console ​

  • Go to Google Play Console > Users and permissions
  • The service account email must be invited with the Release manager role (or custom role with Release to production permission)
  • The service account must be granted access to the app com.professionalperformanceportfolio.ppp

3. Key format in Doppler/GitHub secrets ​

  • GOOGLE_PLAY_SERVICE_ACCOUNT_KEY is the only Doppler-managed secret: it must be the base64-encoded contents of the service account JSON key file. Generate via: base64 -i service-account-key.json | tr -d '\n'
  • It must contain "type": "service_account", "project_id", "private_key", and "client_email" fields once decoded
  • GOOGLE_PLAY_JSON_KEY (the raw-JSON form Fastlane and google-play-metadata-sync.mjs need) is not a separate secret — mobile-store-listing.yml base64-decodes GOOGLE_PLAY_SERVICE_ACCOUNT_KEY into it at point of use; mobile-build-native.yml decodes the same secret straight to a credentials file instead, with no GOOGLE_PLAY_JSON_KEY env var involved (see "Required GitHub Actions Secrets" above)

4. Key expiration ​

  • Google Cloud service account keys do not expire by default, but they can be deleted or rotated
  • If the key was rotated, update GOOGLE_PLAY_SERVICE_ACCOUNT_KEY in Doppler ppp/dev and re-run cd api/infra-github && pnpm up to sync to GitHub Actions

5. Credential validation ​

The mobile-build-native.yml workflow validates the service account JSON structure before attempting submission. Check the "Write and validate store credentials" step output for specific error messages.

See #3112 for the original credential failure investigation.

Internal documentation — org members only