From a3de8eaf46062eda082f2738db3369b141f185b9 Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Fri, 17 Jul 2026 13:22:38 +0300 Subject: [PATCH] Reuse shared build setup in nightly E2E --- .github/scripts/cleanup-nightly-e2e.sh | 5 ++ .github/workflows/nightly-e2e.yml | 97 ++++++++++++++------------ 2 files changed, 57 insertions(+), 45 deletions(-) diff --git a/.github/scripts/cleanup-nightly-e2e.sh b/.github/scripts/cleanup-nightly-e2e.sh index 8511c10b78..d15123403d 100755 --- a/.github/scripts/cleanup-nightly-e2e.sh +++ b/.github/scripts/cleanup-nightly-e2e.sh @@ -5,6 +5,11 @@ set +e platform="${1:?usage: cleanup-nightly-e2e.sh }" device_id="${2:-}" artifact_dir="${GITHUB_WORKSPACE:-$PWD}/artifacts/$platform" +mkdir -p "$artifact_dir" + +if [[ -f i18n.log ]]; then + cp i18n.log "$artifact_dir/i18n.log" +fi stop_process_tree() { local pid="$1" diff --git a/.github/workflows/nightly-e2e.yml b/.github/workflows/nightly-e2e.yml index d4b3f9b3d3..0deb92b622 100644 --- a/.github/workflows/nightly-e2e.yml +++ b/.github/workflows/nightly-e2e.yml @@ -43,21 +43,6 @@ jobs: with: xcode-version: "26.4" - - name: Set up pnpm - uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 - - - name: Set up Node - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 - with: - node-version-file: package.json - cache: pnpm - - - name: Set up Java 17 - uses: actions/setup-java@1bcf9fb12cf4aa7d266a90ae39939e61372fe520 # v5.4.0 - with: - distribution: temurin - java-version: "17" - - name: Prepare E2E configuration run: | mkdir -p artifacts/ios @@ -65,12 +50,22 @@ jobs: cp .env.example .env.test cp google-services.json.example google-services.json - - name: Install dependencies - run: | - set -o pipefail - pnpm install --frozen-lockfile 2>&1 | tee artifacts/ios/dependencies.log - pnpm --dir dev-env install --frozen-lockfile 2>&1 | tee -a artifacts/ios/dependencies.log - pnpm intl:build 2>&1 | tee artifacts/ios/i18n.log + - name: Set up Expo project + uses: ./.github/actions/setup-expo-project + with: + expo-token: ${{ secrets.EXPO_TOKEN }} + + - name: Set up Java 17 + uses: actions/setup-java@1bcf9fb12cf4aa7d266a90ae39939e61372fe520 # v5.4.0 + with: + distribution: temurin + java-version: "17" + + - name: Install dev-env dependencies + run: pnpm --dir dev-env install --frozen-lockfile 2>&1 | tee artifacts/ios/dependencies.log + + - name: Compile translations + uses: ./.github/actions/compile-i18n - name: Install Maestro 2.6.1 run: | @@ -127,21 +122,6 @@ jobs: with: persist-credentials: false - - name: Set up pnpm - uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 - - - name: Set up Node - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 - with: - node-version-file: package.json - cache: pnpm - - - name: Set up Java 17 - uses: actions/setup-java@1bcf9fb12cf4aa7d266a90ae39939e61372fe520 # v5.4.0 - with: - distribution: temurin - java-version: "17" - - name: Prepare E2E configuration run: | mkdir -p artifacts/android @@ -149,12 +129,22 @@ jobs: cp .env.example .env.test cp google-services.json.example google-services.json - - name: Install dependencies - run: | - set -o pipefail - pnpm install --frozen-lockfile 2>&1 | tee artifacts/android/dependencies.log - pnpm --dir dev-env install --frozen-lockfile 2>&1 | tee -a artifacts/android/dependencies.log - pnpm intl:build 2>&1 | tee artifacts/android/i18n.log + - name: Set up Expo project + uses: ./.github/actions/setup-expo-project + with: + expo-token: ${{ secrets.EXPO_TOKEN }} + + - name: Set up Java 17 + uses: actions/setup-java@1bcf9fb12cf4aa7d266a90ae39939e61372fe520 # v5.4.0 + with: + distribution: temurin + java-version: "17" + + - name: Install dev-env dependencies + run: pnpm --dir dev-env install --frozen-lockfile 2>&1 | tee artifacts/android/dependencies.log + + - name: Compile translations + uses: ./.github/actions/compile-i18n - name: Install Maestro 2.6.1 run: | @@ -171,11 +161,28 @@ jobs: - name: Install and boot one Android emulator run: | echo "Booting Android emulator" > artifacts/android/phase.txt - android_sdk="${ANDROID_SDK_ROOT:-${ANDROID_HOME:?ANDROID_HOME is not set}}" - sdkmanager_bin=$(command -v sdkmanager) - avdmanager_bin=$(command -v avdmanager) + android_sdk="${ANDROID_SDK_ROOT:-${ANDROID_HOME:-/usr/local/lib/android/sdk}}" + sdkmanager_bin="$android_sdk/cmdline-tools/latest/bin/sdkmanager" + avdmanager_bin="$android_sdk/cmdline-tools/latest/bin/avdmanager" system_image="system-images;android-35;google_apis;x86_64" + if [ ! -x "$sdkmanager_bin" ] || [ ! -x "$avdmanager_bin" ]; then + echo "Android command-line tools were not found under $android_sdk" >&2 + find "$android_sdk/cmdline-tools" -maxdepth 3 -type f \( \ + -name sdkmanager -o -name avdmanager \ + \) -print >&2 || true + exit 1 + fi + + export ANDROID_HOME="$android_sdk" + export ANDROID_SDK_ROOT="$android_sdk" + export PATH="$android_sdk/platform-tools:$android_sdk/emulator:$PATH" + echo "ANDROID_HOME=$android_sdk" >> "$GITHUB_ENV" + echo "ANDROID_SDK_ROOT=$android_sdk" >> "$GITHUB_ENV" + echo "$android_sdk/platform-tools" >> "$GITHUB_PATH" + echo "$android_sdk/emulator" >> "$GITHUB_PATH" + echo "Using Android SDK at $android_sdk" + yes | "$sdkmanager_bin" --sdk_root="$android_sdk" --licenses >/dev/null || true "$sdkmanager_bin" --sdk_root="$android_sdk" \ "platform-tools" "emulator" "$system_image"