forked from appium/appium-uiautomator2-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Switch CI scripts to GH Actions (appium#479)
- Loading branch information
1 parent
6c050b9
commit 937892d
Showing
13 changed files
with
109 additions
and
225 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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,87 @@ | ||
name: Build | ||
|
||
on: [pull_request, push] | ||
|
||
|
||
jobs: | ||
unit_test: | ||
strategy: | ||
matrix: | ||
node: [14, 16, 18] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '11' | ||
- run: npm i -g npm | ||
name: Update NPM | ||
- run: npm install --no-package-lock | ||
name: Install dev dependencies | ||
- run: npm run lint | ||
name: Run js linter | ||
- run: npm run lint:java | ||
name: Run java linter | ||
- run: npm run test | ||
name: Run unit tests | ||
|
||
e2e_test: | ||
strategy: | ||
matrix: | ||
include: | ||
- platformVersion: "11.0" | ||
apiLevel: 30 | ||
emuTag: google_apis | ||
- platformVersion: "9.0" | ||
apiLevel: 28 | ||
emuTag: default | ||
- platformVersion: "7.1" | ||
apiLevel: 25 | ||
emuTag: default | ||
- platformVersion: "5.1" | ||
apiLevel: 22 | ||
emuTag: default | ||
|
||
env: | ||
CI: true | ||
ANDROID_AVD: emulator | ||
ANDROID_SDK_VERSION: ${{ matrix.apiLevel }} | ||
PLATFORM_VERSION: ${{ matrix.platformVersion }} | ||
EMU_TAG: ${{ matrix.emuTag }} | ||
_FORCE_LOGS: 1 | ||
# No hardware acceleration is available for emulators on Ubuntu: | ||
# https://github.com/marketplace/actions/android-emulator-runner#can-i-use-this-action-on-linux-vms | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: lts/* | ||
check-latest: true | ||
- run: npm install --no-package-lock | ||
name: Install dev dependencies | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '11' | ||
- run: nohup adb logcat > logcat.log & | ||
name: Capture Logcat | ||
- uses: reactivecircus/android-emulator-runner@v2 | ||
name: e2e_api${{ matrix.apiLevel }} | ||
with: | ||
script: scripts/e2e.sh | ||
avd-name: ${{ env.ANDROID_AVD }} | ||
sdcard-path-or-size: 1500M | ||
api-level: ${{ matrix.apiLevel }} | ||
disable-spellchecker: true | ||
target: ${{ matrix.emuTag }} | ||
- name: Save logcat output | ||
if: ${{ always() }} | ||
uses: actions/upload-artifact@master | ||
with: | ||
name: logcat-api${{ matrix.apiLevel }} | ||
path: logcat.log |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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,13 @@ | ||
#!/bin/bash -xe | ||
|
||
classes=(AlertCommandsTest ActionsCommandsTest GestureCommandsTest ElementCommandsTest DeviceCommandsTest) | ||
did_fail=0 | ||
for cls_name in "${classes[@]}"; do | ||
if ! ./gradlew connectedE2eTestDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.class=io.appium.uiautomator2.unittest.test.$cls_name -Pandroid.testInstrumentationRunnerArguments.notAnnotation=io.appium.uiautomator2.unittest.test.internal.SkipHeadlessDevices; then | ||
did_fail=1 | ||
fi | ||
done | ||
|
||
if [[ did_fail -eq 1 ]]; then | ||
exit 1 | ||
fi |