Skip to content

chore: update @bucketeer/js-client-sdk to 2.6.1 (#9) #90

chore: update @bucketeer/js-client-sdk to 2.6.1 (#9)

chore: update @bucketeer/js-client-sdk to 2.6.1 (#9) #90

Workflow file for this run

name: E2e Tests
on:
push:
branches:
- main
workflow_dispatch:
workflow_call:
concurrency:
group: build-e2e-${{ github.ref }}
cancel-in-progress: true
jobs:
build-ios:
name: iOS E2E (React ${{ matrix.react-version }})
runs-on: macos-15-xlarge
timeout-minutes: 45
strategy:
matrix:
react-version: [18, 19]
fail-fast: true
env:
XCODE_VERSION: '26.0.1'
# E2e - maestro framework is not working with iOS 26 simulators properly yet.
IOS_DEVICE_ID: '8354E9A3-172D-4B54-A234-6369EAF61656' # iPhone 16 Pro - iOS 18.6
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
- name: Build package
run: |
yarn build
- name: Prepare Expo prebuild for the demo app - React ${{ matrix.react-version }}
run: |
yarn demo/expo_react_${{ matrix.react-version }} prebuild
- name: Select Xcode version
run: sudo xcode-select -s '/Applications/Xcode_${{ env.XCODE_VERSION }}.app/Contents/Developer'
- name: Boot iPhone Simulator
run: |
xcrun simctl list devices available
xcrun simctl boot ${{ env.IOS_DEVICE_ID }} || echo "Simulator may already be booted"
sleep 10
- name: Restore CocoaPods cache
id: cocoapods-cache
uses: actions/cache/restore@v4
with:
path: |
demo/expo_react_${{ matrix.react-version }}/ios/Pods
demo/expo_react_${{ matrix.react-version }}/ios/Podfile.lock
key: ${{ runner.os }}-pods-react${{ matrix.react-version }}-${{ hashFiles(format('demo/expo_react_{0}/ios/Podfile.lock', matrix.react-version)) }}
restore-keys: |
${{ runner.os }}-pods-react${{ matrix.react-version }}-${{ hashFiles(format('demo/expo_react_{0}/ios/Podfile.lock', matrix.react-version)) }}
${{ runner.os }}-pods-react${{ matrix.react-version }}-
- name: Install CocoaPods dependencies
run: |
cd demo/expo_react_${{ matrix.react-version }}/ios
pod install
cd ../..
- uses: irgaly/xcode-cache@v1
with:
key: xcode-cache-deriveddata-${{ github.workflow }}-react${{ matrix.react-version }}-${{ github.sha }}
restore-keys: xcode-cache-deriveddata-${{ github.workflow }}-react${{ matrix.react-version }}-
- name: Inject environment variables
run: |
rm -f demo/expo_react_${{ matrix.react-version }}/.env
echo "EXPO_PUBLIC_BKT_API_ENDPOINT=${{ secrets.E2E_API_ENDPOINT }}" >> demo/expo_react_${{ matrix.react-version }}/.env
echo "EXPO_PUBLIC_BKT_API_KEY=${{ secrets.E2E_API_KEY }}" >> demo/expo_react_${{ matrix.react-version }}/.env
echo "CI=true" >> demo/expo_react_${{ matrix.react-version }}/.env
- name: Build demo app for iOS (React ${{ matrix.react-version }})
run: |
yarn build:e2e:ios:react${{ matrix.react-version }}
- name: Cache cocoapods dependencies
if: steps.cocoapods-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: |
demo/expo_react_${{ matrix.react-version }}/ios/Pods
demo/expo_react_${{ matrix.react-version }}/ios/Podfile.lock
key: ${{ steps.cocoapods-cache.outputs.cache-primary-key }}
- name: Copy E2E test file for React ${{ matrix.react-version }}
run: |
cp e2e/react_versions/react_${{ matrix.react-version }}.yml e2e/react_version.yml
- name: Run iOS E2E tests (React ${{ matrix.react-version }})
uses: dniHze/maestro-test-action@v1
with:
version: 2.0.10
flow: e2e
report: report.xml
- name: Upload iOS E2E test results (React ${{ matrix.react-version }})
uses: actions/upload-artifact@v4
with:
name: e2e-ios-react${{ matrix.react-version }}-results
path: report.xml
build-android:
name: Android E2E (React ${{ matrix.react-version }})
runs-on: ubuntu-latest
timeout-minutes: 45
strategy:
matrix:
api-level:
- 34
target:
- default # Faster than google_apis
arch:
- x86_64
cores:
- 8
react-version: [18, 19]
fail-fast: true
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
- name: Build package
run: |
yarn build
- name: Prepare Expo prebuild for the demo app - React ${{ matrix.react-version }}
run: |
yarn demo/expo_react_${{ matrix.react-version }} prebuild
- name: Set up JDK 17
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
with:
distribution: "temurin"
java-version: 17
- name: Setup gradle
uses: gradle/actions/setup-gradle@ac638b010cf58a27ee6c972d7336334ccaf61c96 # v4.4.1
id: gradle
continue-on-error: true
with:
gradle-home-cache-cleanup: true
cache-read-only: false
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 2 # Reduce timeout from default 5 minutes
GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true
# Retry gradle setup if it failed (usually due to cache timeout)
- name: Retry Setup gradle
if: steps.gradle.outcome == 'failure'
uses: gradle/actions/setup-gradle@ac638b010cf58a27ee6c972d7336334ccaf61c96 # v4.4.1
with:
gradle-home-cache-cleanup: true
cache-read-only: false
cache-disabled: true # Disable cache on retry to avoid timeout
- name: AVD cache
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ matrix.api-level }}-${{ matrix.target }}-${{ matrix.arch }}
restore-keys: |
avd-${{ matrix.api-level }}-${{ matrix.target }}-
avd-${{ matrix.api-level }}-
- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@1dcd0090116d15e7c562f8db72807de5e036a4ed # v2.34.0
with:
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
arch: ${{ matrix.arch }}
cores: ${{ matrix.cores }}
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -memory 2048 -no-snapshot-load
disable-animations: true
script: echo "Generated AVD snapshot for caching"
- name: Inject environment variables
run: |
rm -f demo/expo_react_${{ matrix.react-version }}/.env
echo "EXPO_PUBLIC_BKT_API_ENDPOINT=${{ secrets.E2E_API_ENDPOINT }}" >> demo/expo_react_${{ matrix.react-version }}/.env
echo "EXPO_PUBLIC_BKT_API_KEY=${{ secrets.E2E_API_KEY }}" >> demo/expo_react_${{ matrix.react-version }}/.env
echo "CI=true" >> demo/expo_react_${{ matrix.react-version }}/.env
- name: Setup Maestro
uses: dniHze/maestro-test-action@v1
with:
version: 2.0.10
- name: Copy E2E test file for React ${{ matrix.react-version }}
run: |
cp e2e/react_versions/react_${{ matrix.react-version }}.yml e2e/react_version.yml
- name: Run Android integration tests (React ${{ matrix.react-version }})
env:
# Optimized Gradle options for CI
GRADLE_OPTS: -Dorg.gradle.daemon=true -Dorg.gradle.parallel=true -Dorg.gradle.caching=true -Dorg.gradle.jvmargs="-Xmx2g -XX:MaxMetaspaceSize=1g -XX:+HeapDumpOnOutOfMemoryError"
uses: reactivecircus/android-emulator-runner@1dcd0090116d15e7c562f8db72807de5e036a4ed # v2.34.0
with:
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
arch: ${{ matrix.arch }}
cores: ${{ matrix.cores }}
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -memory 2048
disable-animations: true
# Run tests with sharding
script: yarn build:e2e:android:react${{ matrix.react-version }} && maestro test e2e --format=junit --output=report.xml --no-ansi
- name: Upload Android E2E test results (React ${{ matrix.react-version }})
uses: actions/upload-artifact@v4
with:
name: e2e-android-react${{ matrix.react-version }}-results
path: report.xml