-
Notifications
You must be signed in to change notification settings - Fork 42
CI: Add blank app fixture runner and appium tests #880
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
descorp
wants to merge
54
commits into
develop
Choose a base branch
from
ci-blank-tests
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 25 commits
Commits
Show all changes
54 commits
Select commit
Hold shift + click to select a range
5e7e4a1
chore: add blank app fixture runner and appium tests
descorp 843d90c
chore: correct typo
descorp 0c870bf
chore: add fixes
descorp a6da3ae
chore: correct title
descorp 6f32c5b
chore: applying fixes
descorp 4c813a6
chore: add missing IDs
descorp 88d1b87
chore: add proper Android runner
descorp 0fce238
chore: add permisions
descorp ec936f7
chore: fix github bug
descorp c5c7730
chore: change ENV to output
descorp 0d8fe95
fix: script by touching yarn.lock
descorp 979cc44
chore: fix appium version
descorp 0754f1b
chore: fix sed command
descorp 931225f
chore: fix pathes
descorp d264646
chore: improving native scripts
descorp d99eb47
choer: lint Appium tests source
descorp ade5037
chore: checking dependenciess
descorp ee9e250
chore: point to iso simulator
descorp c310fe7
chore: improve appium tests
descorp a3651fe
chore: reuse Android emulator
descorp af3d5a4
chore: improving android + more logs
descorp 6774a44
chore: solving slow iOS issue
descorp 779fc06
temp: validating..
descorp 3b3bcac
Merge branch 'develop' into ci-blank-tests
descorp ff8ac63
chore: remove auto run on CI
descorp 930feb6
Merge branch 'develop' into ci-blank-tests
descorp 4743103
chore: remove duplicated code
descorp ee86444
chore: simplify scripts
descorp 1d614ff
chore: prevent checkout on platform run
descorp 74ec150
chore: reuse android setup as an action
descorp 789a927
change: improve appium runner structure
descorp 265111c
chore: ignore e2e on tests
descorp 737e03f
fix: unnececery param
descorp 02a447f
chore: fix missing MainActivity
descorp 5b479c5
chore: remove unnececery || true checks
descorp b0120b7
temp: validate expo..
descorp 9470e7a
Merge branch 'develop' into ci-blank-tests
descorp 13835ec
chore: update setup script to handle Expo platform
descorp 8bf9ae7
chore: apply expo plugin and secrets
descorp 175f0b7
chore: revert hiding ios header
descorp 120c6bf
chore: add xcpretty
descorp 028223b
chore: correct scheme for expo
descorp ee9b1d4
chore: fix podspec
descorp 147ab6b
chore: rework pipeline so it is triggered on demand
descorp 260f1d1
Merge branch 'develop' into ci-blank-tests
descorp 1a4c485
chore: make unique artifacts
descorp 0ca83cf
chore: use custom ios simulator script
descorp 1ac2f57
chore: add xcode logs
descorp 2252601
Merge branch 'develop' into ci-blank-tests
descorp eae0e23
chore: correct bundle ID for Expo and React
descorp e93d936
chore: add swiftlint
descorp 5ab365a
chore: cleanup
descorp d26cf77
chore: reuse build_lib
descorp 4009fe0
fix: add checkout step to android e2e test job
descorp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,318 @@ | ||
| name: Test Blank React Native app | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - develop | ||
|
|
||
| workflow_dispatch: | ||
| inputs: | ||
| platform: | ||
| description: 'Project Type' | ||
| required: true | ||
| type: choice | ||
| options: | ||
| - 'React Native' | ||
| - 'Expo' | ||
| default: 'React Native' | ||
| version: | ||
| description: 'Version (RN e.g. 0.80.2 OR Expo SDK e.g. 52.0.0)' | ||
| required: true | ||
| default: '0.80.2' | ||
| run_ios: | ||
| description: 'Test iOS' | ||
| type: boolean | ||
| default: true | ||
| run_android: | ||
| description: 'Test Android' | ||
| type: boolean | ||
| default: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| env: | ||
| NODE_VERSION: 20 | ||
| ANDROID_API_LEVEL: 35 | ||
| IOS_DEVICE_NAME: "iPhone 17" | ||
| IOS_VERSION: "26.1" | ||
| APP_DIR: "tested_app" | ||
|
|
||
| jobs: | ||
| # ==================================================== | ||
| # JOB 1: Setup Fixture | ||
| # ==================================================== | ||
| setup: | ||
| name: Setup Fixture | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| platform: ${{ steps.vars.outputs.platform }} | ||
| version: ${{ steps.vars.outputs.version }} | ||
| run_ios: ${{ steps.vars.outputs.run_ios }} | ||
| run_android: ${{ steps.vars.outputs.run_android }} | ||
| steps: | ||
| - name: Checkout Code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Resolve Inputs | ||
| id: vars | ||
| shell: bash | ||
| run: | | ||
| if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | ||
| PLATFORM="${{ github.event.inputs.platform }}" | ||
| VERSION="${{ github.event.inputs.version }}" | ||
| RUN_IOS="${{ github.event.inputs.run_ios }}" | ||
| RUN_ANDROID="${{ github.event.inputs.run_android }}" | ||
| else | ||
| PLATFORM="React Native" | ||
| VERSION="0.80.2" | ||
| RUN_IOS="true" | ||
| RUN_ANDROID="true" | ||
| fi | ||
|
|
||
| echo "platform=$PLATFORM" >> "$GITHUB_OUTPUT" | ||
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | ||
| echo "run_ios=$RUN_IOS" >> "$GITHUB_OUTPUT" | ||
| echo "run_android=$RUN_ANDROID" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ env.NODE_VERSION }} | ||
| cache: 'yarn' | ||
|
|
||
| - name: Build Library | ||
| run: | | ||
| yarn | ||
| yarn prepare | ||
| rm -f adyen-react-native-*.tgz | ||
| npm pack | ||
| mv adyen-react-native-*.tgz adyen-react-native.tgz | ||
|
|
||
| - name: Generate Fixture | ||
| run: | | ||
| if [ "${{ steps.vars.outputs.platform }}" == "Expo" ]; then | ||
| FLAG="-e" | ||
| else | ||
| FLAG="-r" | ||
| fi | ||
| bash ./scripts/fixture_setup.sh $FLAG "${{ steps.vars.outputs.version }}" | ||
|
|
||
| - name: Upload Fixture | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: fixture | ||
| path: ${{ env.APP_DIR }} | ||
| retention-days: 1 | ||
|
|
||
| # ==================================================== | ||
| # JOB 2: iOS Build & Test | ||
| # ==================================================== | ||
| ios-test: | ||
| name: iOS Test | ||
| needs: setup | ||
| if: ${{ needs.setup.outputs.run_ios == 'true' }} | ||
| runs-on: macos-15 | ||
| timeout-minutes: 45 | ||
| env: | ||
| ADYEN_CLIENT_KEY: ${{ secrets.ADYEN_CLIENT_KEY }} | ||
| ADYEN_PUBLIC_KEY: ${{ secrets.ADYEN_PUBLIC_KEY }} | ||
|
|
||
| steps: | ||
| - name: Checkout Code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ env.NODE_VERSION }} | ||
| cache: 'yarn' | ||
|
|
||
| - name: Setup Ruby & Cocoapods | ||
| uses: ruby/setup-ruby@v1 | ||
| with: | ||
| ruby-version: '3.2' | ||
| bundler-cache: true | ||
|
|
||
| - name: Download Fixture | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: fixture | ||
| path: ${{ env.APP_DIR }} | ||
|
|
||
| - name: Install Dependencies | ||
| working-directory: ${{ env.APP_DIR }} | ||
| run: | | ||
| yarn install | ||
|
|
||
| - name: Setup Appium | ||
| run: | | ||
| npm i -g appium | ||
| appium driver install xcuitest | ||
|
|
||
| - name: Start Appium | ||
| run: | | ||
| appium --port 4723 --log-level error & | ||
| for i in {1..90}; do | ||
| if curl -sf http://127.0.0.1:4723/status >/dev/null; then | ||
|
||
| exit 0 | ||
| fi | ||
| sleep 1 | ||
| done | ||
| exit 1 | ||
|
|
||
| - name: Inject Secrets | ||
| if: ${{ env.ADYEN_CLIENT_KEY != '' && env.ADYEN_PUBLIC_KEY != '' }} | ||
| run: | | ||
| bash ./scripts/inject_secrets.sh "$APP_DIR" | ||
|
|
||
| - name: Run iOS Test | ||
| run: | | ||
| bash ./scripts/fixture_ios.sh "$APP_DIR" "${{ needs.setup.outputs.platform }}" "${{ env.IOS_DEVICE_NAME }}" "${{ env.IOS_VERSION }}" | ||
|
|
||
| - name: Upload Appium Failure Screenshot (iOS) | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: appium_failure_ios | ||
| path: ${{ env.APP_DIR }}/appium_failure.png | ||
| if-no-files-found: ignore | ||
| retention-days: 1 | ||
|
|
||
| - name: Upload Appium Page Source (iOS) | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: appium_page_source_ios | ||
| path: ${{ env.APP_DIR }}/appium_page_source.xml | ||
| if-no-files-found: ignore | ||
| retention-days: 1 | ||
|
|
||
| # ==================================================== | ||
| # JOB 3: Android Build & Test | ||
| # ==================================================== | ||
| android-test: | ||
|
||
| name: Android Test | ||
| needs: setup | ||
| if: ${{ needs.setup.outputs.run_android == 'true' }} | ||
| runs-on: ubuntu-24.04 | ||
| timeout-minutes: 45 | ||
| env: | ||
| ADYEN_CLIENT_KEY: ${{ secrets.ADYEN_CLIENT_KEY }} | ||
| ADYEN_PUBLIC_KEY: ${{ secrets.ADYEN_PUBLIC_KEY }} | ||
| target: google_apis | ||
| arch: x86_64 | ||
|
|
||
| steps: | ||
| - name: Provide more disk space | ||
| run: | | ||
| sudo rm -rf /opt/hostedtoolcache | ||
| sudo rm -rf /usr/share/dotnet | ||
| sudo rm -rf /opt/ghc /opt/cabal /opt/stack | ||
| sudo rm -rf /usr/local/.ghcup | ||
| sudo rm -rf "/usr/local/share/boost" | ||
| sudo apt-get remove -y 'php.*' | ||
| sudo docker image prune --all --force | ||
|
|
||
| - name: Checkout Code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ env.NODE_VERSION }} | ||
| cache: 'yarn' | ||
|
|
||
| - name: Setup Java | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| distribution: 'zulu' | ||
| java-version: '17' | ||
|
|
||
| - name: Gradle cache | ||
| uses: gradle/actions/setup-gradle@v5 | ||
|
|
||
| - name: Enable KVM (Linux Acceleration) | ||
| 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: AVD cache | ||
| uses: actions/cache@v5 | ||
| id: avd-cache | ||
| with: | ||
| path: | | ||
| ~/.android/avd/* | ||
| ~/.android/adb* | ||
| key: avd-${{ env.ANDROID_API_LEVEL }} | ||
|
|
||
| - name: Create AVD and generate snapshot for caching | ||
| if: steps.avd-cache.outputs.cache-hit != 'true' | ||
| uses: reactivecircus/android-emulator-runner@v2 | ||
| with: | ||
| api-level: ${{ env.ANDROID_API_LEVEL }} | ||
| target: ${{ env.target }} | ||
| arch: ${{ env.arch }} | ||
| force-avd-creation: false | ||
| emulator-boot-timeout: 300 | ||
| script: echo "Generated AVD snapshot for caching." | ||
|
|
||
| - name: Download Fixture | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: fixture | ||
| path: ${{ env.APP_DIR }} | ||
|
|
||
| - name: Install Dependencies | ||
| working-directory: ${{ env.APP_DIR }} | ||
| run: | | ||
| yarn install | ||
|
|
||
| - name: Setup Appium | ||
| run: | | ||
| npm i -g appium | ||
| appium driver install uiautomator2 | ||
|
|
||
| - name: Start Appium | ||
| run: | | ||
| appium --port 4723 --log-level error & | ||
| for i in {1..30}; do | ||
| nc -z 127.0.0.1 4723 && exit 0 | ||
| sleep 1 | ||
| done | ||
| exit 1 | ||
|
|
||
| - name: Inject Secrets | ||
| if: ${{ env.ADYEN_CLIENT_KEY != '' && env.ADYEN_PUBLIC_KEY != '' }} | ||
| run: | | ||
| bash ./scripts/inject_secrets.sh "$APP_DIR" | ||
|
|
||
| - name: Run Android Test | ||
| uses: reactivecircus/android-emulator-runner@v2 | ||
| with: | ||
| api-level: ${{ env.ANDROID_API_LEVEL }} | ||
| target: ${{ env.target }} | ||
| arch: ${{ env.arch }} | ||
| force-avd-creation: false | ||
| emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | ||
| script: | | ||
| bash ./scripts/fixture_android.sh "$APP_DIR" "${{ needs.setup.outputs.platform }}" "${{ env.ANDROID_API_LEVEL }}" | ||
|
|
||
| - name: Upload Appium Failure Screenshot (Android) | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: appium_failure_android | ||
| path: ${{ env.APP_DIR }}/appium_failure.png | ||
| if-no-files-found: ignore | ||
| retention-days: 1 | ||
|
|
||
| - name: Upload Appium Page Source (Android) | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: appium_page_source_android | ||
| path: ${{ env.APP_DIR }}/appium_page_source.xml | ||
| if-no-files-found: ignore | ||
| retention-days: 1 | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.