From ca3fd56017f45c36989e5faaa48fbe55c2186f39 Mon Sep 17 00:00:00 2001 From: Djordje <46656919+DordeDimitrijev@users.noreply.github.com> Date: Thu, 27 Jun 2024 12:31:12 +0200 Subject: [PATCH] Migrate github actions to ADO (#2716) * Create config yml for tests * Add setup for android tests * Remove unnecessary jobs * Remove support for outdated Ruby version * Add ios tests config; Modify npx react-native cmd * Replace ios stage with job * Revert changes on test.ts for npx * Fix typo in script * Remove github-actions yml --- .azurepipelines/test-rn-code-push.yml | 93 +++++++++++++++++++ .../workflows/react-native-code-push-ci.yml | 70 -------------- 2 files changed, 93 insertions(+), 70 deletions(-) create mode 100644 .azurepipelines/test-rn-code-push.yml delete mode 100644 .github/workflows/react-native-code-push-ci.yml diff --git a/.azurepipelines/test-rn-code-push.yml b/.azurepipelines/test-rn-code-push.yml new file mode 100644 index 000000000..8b1d14a36 --- /dev/null +++ b/.azurepipelines/test-rn-code-push.yml @@ -0,0 +1,93 @@ +trigger: +- master + +pr: +- master + +variables: +- name: api-level + value: '27' + +pool: + vmImage: 'macOS-12' + +stages: +- stage: RunTests + displayName: 'Run Android & IOS tests' + jobs: + - job: TestAndroid + timeoutInMinutes: 120 + displayName: 'Test android' + steps: + + - script: | + adb devices + displayName: 'Start adb server' + + - script: | + $ANDROID_HOME/tools/bin/sdkmanager "system-images;android-$(api-level);google_apis;x86" + displayName: 'Download system image' + + - script: | + $ANDROID_HOME/tools/bin/avdmanager create avd --force --name TestEmulator --abi google_apis/x86 --package 'system-images;android-$(api-level);google_apis;x86' --device "Nexus 6P" + displayName: 'Creating Android emulator' + + - script: | + $ANDROID_HOME/emulator/emulator -avd TestEmulator -noaudio -no-window -no-snapshot-save -no-boot-anim -memory 6144 & + displayName: 'Start Android emulator' + + - script: | + $ANDROID_HOME/platform-tools/adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed | tr -d '\r') ]]; do sleep 1; done' + displayName: 'Wait for emulator to boot' + + - script: | + adb shell settings put global window_animation_scale 0.0 + displayName: 'Disable animations and transitions' + + - script: | + adb shell settings put global transition_animation_scale 0.0 + displayName: 'Disable animations and transitions' + + - script: | + adb shell settings put global animator_duration_scale 0.0 + displayName: 'Disable animations and transitions' + + + - task: JavaToolInstaller@0 + inputs: + versionSpec: '11' + jdkArchitectureOption: 'x64' + jdkSourceOption: 'PreInstalled' + displayName: 'Change Java version' + + - script: | + npm install + displayName: 'Package Installation' + + - script: | + npm run build:tests && npm run test:setup:android + displayName: 'Setup Android tests' + + - script: | + npm run test:fast:android + displayName: 'Run Android test' + + - job: TestIOS + displayName: 'Test IOS' + steps: + + - script: | + npm install + displayName: 'Install dependencies' + + - script: | + npm run build:tests && npm run test:setup:ios + displayName: 'Setup iOS tests' + + - script: | + npm run test:fast:ios + displayName: 'Run tests' + + + + diff --git a/.github/workflows/react-native-code-push-ci.yml b/.github/workflows/react-native-code-push-ci.yml deleted file mode 100644 index 9fdf01fc9..000000000 --- a/.github/workflows/react-native-code-push-ci.yml +++ /dev/null @@ -1,70 +0,0 @@ -name: React-native-code-push CI - -on: - pull_request: - branches: - - master - -jobs: - test-android: - name: Test Android app - runs-on: macos-latest - strategy: - matrix: - api-level: [ 27 ] - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Start adb server - run: adb devices - - name: Gradle cache - uses: gradle/gradle-build-action@v2 - - name: Download system image "android-${{ matrix.api-level }}" - run: $ANDROID_HOME/tools/bin/sdkmanager "system-images;android-${{ matrix.api-level }};google_apis;x86" - - name: Create android emulator - run: $ANDROID_HOME/tools/bin/avdmanager create avd --force --name TestEmulator --abi google_apis/x86 --package 'system-images;android-${{ matrix.api-level }};google_apis;x86' --device "Nexus 6P" - - name: Start android emulator - run: $ANDROID_HOME/emulator/emulator -avd TestEmulator -noaudio -no-window -no-snapshot-save -no-boot-anim -memory 6144 & - - name: Wait for emulator to boot - run: $ANDROID_HOME/platform-tools/adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed | tr -d '\r') ]]; do sleep 1; done' - - run: adb shell settings put global window_animation_scale 0.0 - - run: adb shell settings put global transition_animation_scale 0.0 - - run: adb shell settings put global animator_duration_scale 0.0 - - name: Setup Java - uses: actions/setup-java@v3 - with: - distribution: 'microsoft' - java-version: '11' - - name: Setup Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7.6' - bundler-cache: true - - name: Package Installation - run: npm install - - name: Setup Android tests - run: npm run build:tests && npm run test:setup:android - - name: Run Android test - run: npm run test:fast:android - - test-iOS: - name: Test iOS app - runs-on: macos-latest - env: - NO_FLIPPER: ${{ secrets.NO_FLIPPER }} - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Setup Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7.6' - bundler-cache: true - - name: (Workaround) Install activesupport 7.0.8 - run: gem install activesupport -v 7.0.8 - - name: Install dependencies - run: npm install - - name: Setup iOS tests - run: npm run build:tests && npm run test:setup:ios - - name: Run tests - run: npm run test:fast:ios