.gitlab-ci.yml 976 Bytes
Newer Older
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
# TODO: consider replacing this with a smaller image
image: docker.io/inovex/gitlab-ci-android

stages:
  - build
  - test

variables:
  GRADLE_OPTS: "-Dorg.gradle.daemon=false"

before_script:
  - export GRADLE_USER_HOME=$(pwd)/.gradle
  - export ANDROID_HOME=${ANDORID_SDK_HOME}
  - echo "sdk.dir=${ANDROID_SDK_HOME}" > ./android/local.properties
  - echo "ndk.dir=${ANDROID_NDK_HOME}" >> ./android/local.properties
  - cp -R $ANDROID_SDK_ROOT/licenses ./android/.
  - chmod +x ./android/gradlew

cache:
  key: ${CI_PROJECT_ID}
  paths:
    - android/.gradle/

build:android:aar:
  stage: build
  tags:
    - docker
  script:
    - pushd android
    - ./gradlew clean assembleRelease
  artifacts:
    expire_in: 1 weeks
    paths:
      - android/olm-sdk/build/outputs/aar/*.aar
      - android/local.properties

test:android:aar:
  stage: test
  tags:
    - docker
  script:
    - pushd android
    # TODO: fix this?
    # - ./gradlew test
  needs:
    - build:android:aar