-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
44 lines (40 loc) · 1.63 KB
/
.gitlab-ci.yml
File metadata and controls
44 lines (40 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
image: maxistar/android:latest
before_script:
- 'command -v ssh-agent >/dev/null || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
stages:
- build
- execute
build:
stage: build
tags:
- fomalgaut
script:
- echo "Building"
- cp local.properties.dist local.properties
- gradle assembleDebug --no-daemon
- gradle compileDebugSources
- gradle compileDebugAndroidTestSources
- gradle assembleAndroidTest --no-daemon
- echo "Upload compiled binaries"
- scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk $PHYSICAL_DEVICE_RUNNER:$APK_LOCATION/app-debug-androidTest.apk
- scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null app/build/outputs/apk/debug/app-debug.apk $PHYSICAL_DEVICE_RUNNER:$APK_LOCATION/app-debug.apk
- echo "Done stage Fomalgaut"
execute:
stage: execute
tags:
- altair
script:
- echo "Execute Compliled Tests"
- adb -s $ADB_DEVICE_NAME uninstall com.maxistar.textpad.test || true
- adb -s $ADB_DEVICE_NAME uninstall com.maxistar.textpad || true
- adb -s $ADB_DEVICE_NAME install -r -t -g -d $APK_LOCATION/app-debug-androidTest.apk
- adb -s $ADB_DEVICE_NAME install -r -t -g -d $APK_LOCATION/app-debug.apk
- echo "Run tests"
- adb -s $ADB_DEVICE_NAME shell input keyevent 82
- sleep 1
- adb -s $ADB_DEVICE_NAME shell am instrument -w -e debug false com.maxistar.textpad.test/androidx.test.runner.AndroidJUnitRunner
- exit $?