-
Notifications
You must be signed in to change notification settings - Fork 570
ci: move Azure to GHA (Android) #1007
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
Changes from all commits
c237299
31c5a4f
d1620fc
ee79462
619a723
9562006
d9cbf9f
36b9cc7
e8c029f
b6e8e04
3b9702a
67c969c
2ee88c1
ca38307
557c343
40db455
ee9659b
40a7e2b
102b9fd
a4f0c89
f546827
8e2a59e
7da6b1a
482deae
68db2b1
721e408
5fb985f
a45ba43
f62953c
89d0a38
abdbb14
737f306
c0433ff
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,6 +27,13 @@ jobs: | |
|
|
||
| runs-on: macos-14 | ||
|
|
||
| # Please make sure the available Xcode versions and iOS versions | ||
| # on the runner images. https://github.com/actions/runner-images | ||
| env: | ||
| XCODE_VERSION: 15.3 | ||
| IOS_VERSION: 17.4 | ||
| IPHONE_MODEL: iPhone 15 Plus | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v3 | ||
|
|
||
|
|
@@ -38,14 +45,14 @@ jobs: | |
| - name: Select Xcode | ||
| uses: maxim-lobanov/setup-xcode@v1 | ||
| with: | ||
| xcode-version: 15.3 | ||
| xcode-version: ${{ env.XCODE_VERSION }} | ||
| - run: defaults write com.apple.iphonesimulator PasteboardAutomaticSync -bool false | ||
|
|
||
| - uses: futureware-tech/simulator-action@v3 | ||
| with: | ||
| # https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md | ||
| model: 'iPhone 15 Plus' | ||
| os_version: '17.4' | ||
| model: ${{ env.IPHONE_MODEL }} | ||
|
mykola-mokhnach marked this conversation as resolved.
|
||
| os_version: ${{ env.IOS_VERSION }} | ||
|
|
||
| # needed? | ||
| - run: brew install ffmpeg | ||
|
|
@@ -77,3 +84,101 @@ jobs: | |
| with: | ||
| name: appium-ios-${{matrix.test_targets.name}}.log | ||
| path: appium.log | ||
|
|
||
|
|
||
| android_test: | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| test_targets: | ||
| - target: test/functional/android/device_time_tests.py test/functional/android/search_context/find_by_*.py | ||
| name: func_test_android1 | ||
|
|
||
| runs-on: ubuntu-latest | ||
|
|
||
| env: | ||
| API_LEVEL: 29 | ||
| ARCH: x86 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v3 | ||
|
|
||
| - uses: actions/setup-java@v3 | ||
| with: | ||
| distribution: 'temurin' | ||
| java-version: '17' | ||
|
|
||
| - name: Install Node.js | ||
| uses: actions/setup-node@v3 | ||
| with: | ||
| node-version: 'lts/*' | ||
|
|
||
| # Start Appium | ||
| - run: npm install -g appium | ||
| - run: | | ||
| appium driver install uiautomator2 | ||
| appium driver install espresso | ||
| appium plugin install images | ||
| appium plugin install execute-driver | ||
| nohup appium --use-plugins=images,execute-driver --relaxed-security --log-timestamp --log-no-colors 2>&1 > appium.log & | ||
|
|
||
| - name: Enable KVM group perms | ||
| 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@v3 | ||
| id: avd-cache | ||
| with: | ||
| path: | | ||
| ~/.android/avd/* | ||
| ~/.android/adb* | ||
| key: avd-${{ env.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.API_LEVEL }} | ||
| arch: ${{ env.ARCH }} | ||
| target: google_apis | ||
| force-avd-creation: false | ||
| emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | ||
| disable-animations: false | ||
| script: echo "Generated AVD snapshot for caching." | ||
|
|
||
| - name: Set up Python 3.9 | ||
| uses: actions/setup-python@v3 | ||
| with: | ||
| python-version: 3.9 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should it rather be latest python?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Eventually, I'm thinking of making it the latest. For now, this is my local (mac's) default major version to test this out on my local and the GHA env.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. np, just leave a TODO there for later so we don't forget about it. |
||
|
|
||
| - name: run tests | ||
| uses: reactivecircus/android-emulator-runner@v2 | ||
| with: | ||
| api-level: ${{ env.API_LEVEL }} | ||
| arch: ${{ env.ARCH }} | ||
| script: | | ||
| # Separate 'run' creates differnet pipenv env. Does them in one run for now. | ||
| pip install --upgrade pip | ||
| pip install --upgrade pipenv | ||
| pipenv lock --clear | ||
| pipenv install -d --system | ||
| pytest ${{ matrix.test_targets.target}} --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html | ||
| target: google_apis | ||
| profile: Nexus 5X | ||
| disable-spellchecker: true | ||
| disable-animations: true | ||
|
|
||
| env: | ||
| ANDROID_SDK_VERSION: ${{ env.API_LEVEL }} | ||
| APPIUM_DRIVER: ${{matrix.test_targets.automation_name}} | ||
| IGNORE_VERSION_SKIP: true | ||
| CI: true | ||
|
|
||
| - name: Save server output | ||
| if: ${{ always() }} | ||
| uses: actions/upload-artifact@master | ||
| with: | ||
| name: appium-android-${{matrix.test_targets.name}}.log | ||
| path: appium.log | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe add a note that in order to change xcode version one must also check for compatible macOS version in the compat matrix