forked from openedx-unsupported/edx-app-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
84 lines (75 loc) · 2.65 KB
/
.travis.yml
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
language: android
jdk: oraclejdk8
sudo: required
# Use trusty distribution to resolve the adb(requires at least GLIBC_2.16 version) execution failure
# Reference: https://github.com/atom/atom/issues/14440#issuecomment-302158430
# Reference: https://docs.travis-ci.com/user/reference/trusty/
dist: trusty # For 7.5GB of memory since the emulator requires a big chunk.
env:
matrix:
- ANDROID_TARGET=android-27
global:
- ADB_INSTALL_TIMEOUT=12
android:
components:
- tools
- platform-tools
# The BuildTools version used
- build-tools-28.0.3
# The SDK version used to compile the project
- android-28
# Required to define the system image for an Android-21 emulator to use
# Reference: https://github.com/travis-ci/travis-ci/issues/6606#issuecomment-257090318
- android-21
# Defined for adding emulator system image type and android version
# (required by trusty distribution) before creating an emulator.
- sys-img-armeabi-v7a-android-21
# Additional components
- extra-google-m2repository
- extra-android-m2repository
licenses:
- 'android-sdk-license-.+'
- '.+'
notifications:
email: true
before_script:
- git fetch --tags
- git fetch --unshallow || true
- export DESCRIBE=$(git describe)
- export PR=https://api.github.com/repos/$TRAVIS_REPO_SLUG/pulls/$TRAVIS_PULL_REQUEST
- export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo `curl -s $PR | jq -r .head.ref`; fi)
- echo "TRAVIS_BRANCH=$TRAVIS_BRANCH, PR=$PR, BRANCH=$BRANCH, DESCRIBE=$DESCRIBE"
- chmod +x gradlew
# Begin spinning up an emulator in the background
- make emulator
script:
- make quality
- make test
# Check if emulator has finished booting
- android-wait-for-emulator
- adb shell input keyevent 82 &
- travis_wait 30 make e2e
# Script to check linting issues.
- ./gradlew lintProdDebug
after_script:
- make artifacts
- mv OpenEdXMobile/screenshots artifacts/
- curl -sL https://raw.githubusercontent.com/travis-ci/artifacts/master/install | bash
- ~/bin/artifacts upload artifacts
branches:
only:
- master
# Enable caching to speed up the build
cache:
directories:
- $HOME/.gradle
before_install:
- mkdir "$ANDROID_HOME/licenses" || true
# Added cuz Travis doesn't accept license agreements of ConstraintLayout.
# To fix it, we are copying the licenses that come with the SDK to Travis's directory.
# Reference: https://github.com/wolkenschieber/License/blob/master/.travis.yml#L35
- cp ./android-sdk-licenses/* "$ANDROID_HOME/licenses/"
- pip install --user codecov
- pip install --user pillow # For screenshot tests
after_success:
- codecov