Skip to content

3.3.2-3

3.3.2-3 #664

Workflow file for this run

name: CI PR Checks
env:
DEVELOPER_DIR: /Applications/Xcode_16.0.0.app/Contents/Developer
on: pull_request
jobs:
eslint:
name: ESLint
permissions:
actions: write
contents: write
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v3
with:
node-version: '18'
- name: 'Checkout ${{ inputs.ref }}'
uses: actions/checkout@v3
with:
path: source
ref: '${{ inputs.ref }}'
- name: Install dependencies
run: yarn --frozen-lockfile --prefer-offline
working-directory: source/
- name: Linter
run: |
npx eslint . --ext .js,.jsx,.ts,.tsx
working-directory: source/
tsc:
name: Generate Declaration Files
permissions:
actions: write
contents: write
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v3
with:
node-version: '18'
- name: 'Checkout ${{ inputs.ref }}'
uses: actions/checkout@v3
with:
path: source
ref: '${{ inputs.ref }}'
- name: Install dependencies
run: yarn --frozen-lockfile --prefer-offline
working-directory: source/
- name: Generate .d files
run: |
npx tsc
working-directory: source/
eslintapps:
name: ESLint Sample Apps
permissions:
actions: write
contents: write
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v3
with:
node-version: '18'
- name: 'Checkout ${{ inputs.ref }}'
uses: actions/checkout@v3
with:
path: source
ref: '${{ inputs.ref }}'
- name: Pack the SDK
run: |
npm install
npm run prepare && npm pack
working-directory: source/
- name: Install test app dependencies
run: |
npm run clean && npm run getsdk && npm run build
working-directory: source/examples/Basic
- name: Linter Basic
run: |
npx eslint . --ext .js,.jsx,.ts,.tsx
working-directory: source/examples/Basic
- name: Install TestNamiTV app dependencies
run: yarn --frozen-lockfile --prefer-offline
working-directory: source/examples/TestNamiTV
- name: Linter TestNamiTV
run: |
npx eslint . --ext .js,.jsx,.ts,.tsx
working-directory: source/examples/TestNamiTV
e2e-ios:
runs-on: macos-15
env:
DETOX_CONFIGURATION: ios.sim.release
steps:
- uses: actions/setup-node@v3
with:
node-version: 18
- name: 'Checkout ${{ inputs.ref }}'
uses: actions/checkout@v3
with:
path: source
ref: '${{ inputs.ref }}'
- name: Cache node_modules
uses: actions/cache@v3
id: cache
with:
path: source/examples/Basic/node_modules
key: node-modules-${{ hashFiles('**/yarn.lock') }}
- name: Pack the SDK
run: |
npm install
npm run prepare && npm pack
working-directory: source/
- name: Install test app dependencies
run: |
npm run clean && npm run getsdk && npm run build
working-directory: source/examples/Basic
- name: Install macOS dependencies
run: |
brew tap wix/brew
brew install applesimutils
sudo gem install cocoapods
gem install CFPropertyList
env:
# Speed up build could be updated 0/1 for full install
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
- name: Update App Platform ID
working-directory: source/examples/Basic/config/
run: |
sed -i '' -e "s/APPLE_PROD_APP_PLATFORM_ID/$BASIC_APPLE_PROD_APP_PLATFORM_ID/" index.ts
env:
BASIC_APPLE_PROD_APP_PLATFORM_ID: '${{ secrets.APPLE_PROD_APP_PLATFORM_ID }}'
- name: Clean node_modules tree
run: rm -rf node_modules/react-native-nami-sdk/examples
working-directory: source/examples/Basic
- name: Install iOS pods
run: RCT_NEW_ARCH_ENABLED=0 SWIFT_VERSION=5 pod install --repo-update
working-directory: source/examples/Basic/ios
- name: Rebuild cache detox
run: yarn detox rebuild-framework-cache
working-directory: source/examples/Basic
- name: Cache Detox build
id: cache-detox-build
uses: actions/cache@v3
with:
path: source/examples/Basic/ios/Pods
key: ${{ runner.os }}-detox-build
restore-keys: |
${{ runner.os }}-detox-build
- name: Detox build
run: yarn detox build --configuration ${{ env.DETOX_CONFIGURATION }}
working-directory: source/examples/Basic
- name: Detox test
run: |
export DETOX_SYNCHRONIZATION_DEBUG=1
yarn start &
METRO_BUNDLER_PID=$!
yarn detox test --configuration ${{ env.DETOX_CONFIGURATION }} e2e/ios --cleanup --config=e2e/ios-jest.config.js --headless --record-logs all --loglevel trace
DETOX_EXIT_CODE=$?
kill $METRO_BUNDLER_PID
exit $DETOX_EXIT_CODE
working-directory: source/examples/Basic
- name: Upload artifacts
if: failure()
uses: actions/upload-artifact@v4
with:
name: detox-artifacts
path: artifacts
e2e-android:
runs-on: priority-l
env:
DETOX_CONFIGURATION: android.emu.release
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
path: source
ref: '${{ inputs.ref }}'
- 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: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Cache node_modules
uses: actions/cache@v3
id: cache
with:
path: source/examples/Basic/node_modules
key: node-modules-${{ hashFiles('**/yarn.lock') }}
- name: Pack the SDK
run: |
npm install
npm run prepare && npm pack
working-directory: source/
- name: Install test app dependencies
run: |
npm run clean && npm run getsdk && npm run build
working-directory: source/examples/Basic
- name: Setup Java
uses: actions/setup-java@v3
with:
cache: gradle
distribution: temurin
java-version: 17
- name: Update App Platform ID
working-directory: source/examples/Basic/config/
run: |
sed -i "s/ANDROID_PROD_APP_PLATFORM_ID/$BASIC_ANDROID_PROD_APP_PLATFORM_ID/" index.ts
#sed -i '' -e "s/ANDROID_PROD_APP_PLATFORM_ID/$BASIC_ANDROID_PROD_APP_PLATFORM_ID/" index.ts
env:
BASIC_ANDROID_PROD_APP_PLATFORM_ID: '${{ secrets.ANDROID_PROD_APP_PLATFORM_ID }}'
- name: Update Proguard for Detox
working-directory: source/examples/Basic/android
run: |
sed -i 's|proguardFiles.*|proguardFile "${rootProject.projectDir}/../node_modules/detox/android/detox/proguard-rules-app.pro"|' app/build.gradle
- name: Rebuild cache detox
run: yarn detox rebuild-framework-cache
working-directory: source/examples/Basic
- name: Cache Detox build
id: cache-detox-build
uses: actions/cache@v3
with:
path: source/examples/Basic/android/app/build
key: ${{ runner.os }}-detox-build
restore-keys: |
${{ runner.os }}-detox-build
- name: Detox build
run: |
rm -rf node_modules/react-native-nami-sdk/examples
yarn detox build --configuration ${{ env.DETOX_CONFIGURATION }}
working-directory: source/examples/Basic
- name: Increase ADB Install timeout
run: sed -i 's/INSTALL_TIMEOUT = 45000;/INSTALL_TIMEOUT = 300000;/' node_modules/detox/src/devices/common/drivers/android/exec/ADB.js
working-directory: source/examples/Basic
- name: Create the Keystore
run: |
# import keystore from secrets
echo $KEYSTORE_BASE64 | base64 -d > $RUNNER_TEMP/my_production.keystore
env:
KEYSTORE_BASE64: '${{ secrets.KEY_STORE_BASE64 }}'
- name: Encode the keystore to base64
id: encode_keystore
run: |
echo "SIGNINGKEYBASE64=$(openssl base64 < $RUNNER_TEMP/my_production.keystore | tr -d '\n')" >> $GITHUB_ENV
- name: Sign APK
id: sign_apk
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: source/examples/Basic/android/app/build/outputs/apk/production/release/
signingKeyBase64: ${{ env.SIGNINGKEYBASE64 }}
alias: ${{ secrets.KEY_ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
env:
BUILD_TOOLS_VERSION: '35.0.0'
- name: Sign AndroidTest APK for Detox
id: sign_androidTest_apk
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: source/examples/Basic/android/app/build/outputs/apk/androidTest/production/release/
signingKeyBase64: ${{ env.SIGNINGKEYBASE64 }}
alias: ${{ secrets.KEY_ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
env:
BUILD_TOOLS_VERSION: '35.0.0'
- name: Get device name
id: device
run: node -e "console.log('AVD_NAME=' + require('./.detoxrc').devices.emulator.device.avdName)" >> $GITHUB_OUTPUT
working-directory: source/examples/Basic
- name: Start ADB daemon early
run: |
export PATH=$ANDROID_HOME/platform-tools:$PATH
adb start-server
adb devices
- name: Start emulator
uses: reactivecircus/android-emulator-runner@v2
with:
target: aosp_atd
api-level: 30
arch: x86
channel: canary
profile: pixel
ram-size: 2048M
heap-size: 576M
avd-name: Pixel_3a_API_30_AOSP
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
disable-linux-hw-accel: false
working-directory: source/examples/Basic
script: adb wait-for-device; boot_completed=""; until [ "$boot_completed" = "1" ]; do boot_completed=$(adb shell getprop sys.boot_completed 2>/dev/null | tr -d '\r'); echo "Waiting for emulator... boot_completed=$boot_completed"; sleep 5; done; echo "Emulator is ready!"; yarn detox test --configuration ${{ env.DETOX_CONFIGURATION }} --config=e2e/android-jest.config.js --headless --record-logs all --loglevel trace; adb logcat -d *:E
- name: Upload artifacts
if: failure()
uses: actions/upload-artifact@v4
with:
name: detox-artifacts
path: artifacts