Android – GitLab.com CI shared runner for Android projects

androidandroid-gradle-plugingitlabgitlab-cigitlab-ci-runner

I'd like to use GitLab CI system for my Android application gradle project. The project repository is hosted on GitLab.com, so I'd like to use one of the Shared Runners provided by Gitlab Inc.
While the official tutorial provides an example for NodeJS project runner configuration and there are also shared runners for Ruby projects, I couldn't find any example or even a runner that supports Android applications.

  • Is there a shared runner provided by GitLab.com, which supports Android projects out of the box (by specifying image: android:4.2.2 or something like this)?
  • Is there a way to configure existing shared runner provided by GitLab.com to support Android projects (by modifying the .gitlab-ci.yml file)?

Best Answer

I'm using this docker image to run android build on gitlab-ci

Update:

Moved to Gitlab registry

image: registry.gitlab.com/showcheap/android-ci:latest

before_script:
    - export GRADLE_USER_HOME=`pwd`/.gradle
    - chmod +x ./gradlew

cache:
  paths:
     - .gradle/wrapper
     - .gradle/caches

build:
  stage: build
  script:
     - ./gradlew assemble

test:
  stage: test
  script:
     - ./gradlew check

Full Guide can check in this Gitlab Repository: https://gitlab.com/showcheap/android-ci

If your Target SDK and Build Tools version are not listed, please make a pull request or fork my repo then make your custom target and build version.