Sign inSign up

megakrutak/gitlab-ci-android

By megakrutak

•Updated about 6 years ago

GitLab CI image for building Android apps and testing with Firebase Test Lab

Image
1

4.3K

megakrutak/gitlab-ci-android repository overview

⁠gitlab-ci-android

This Docker image contains the Android SDK and most common packages necessary for building Android apps in GitLab CI and testing with Firebase Test Lab.

A .gitlab-ci.yml with caching of your project's dependencies would look like this:

image: megakrutak/gitlab-ci-android

variables:
  VERSION_SDK_TOOLS: "3859397" # "26.0.1"
  GCLOUD_AUTH_KEY_FILE: "authKeyFile.json"
  GCLOUD_PROJECT_ID: "project-id"
  GITLAB_HOST: "my-gitlab-server.com"
  GITLAB_HOST_IP: "192.168.1.1"

stages:
- build
- test

before_script:
- export GRADLE_USER_HOME=$(pwd)/.gradle
- chmod +x ./gradlew

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

build:
  stage: build
  script:
  - ./gradlew assembleDebug
  artifacts:
    paths:
    - app/build/outputs/apk/app-debug.apk

test:
  stage: test
  script:
  - chmod 777 $GCLOUD_AUTH_KEY_FILE
  - echo n | gcloud init
  - gcloud auth activate-service-account --key-file="${GCLOUD_AUTH_KEY_FILE}"
  - gcloud config set project $GCLOUD_PROJECT_ID
  - gcloud firebase test android models list
  - ./gradlew clean assembleMock assembleAndroidTest -PdisablePreDex
  - gcloud firebase test android run firebase-test-matrix.yml:nexus5-device --app app/build/outputs/apk/app-mock-debug.apk --test app/build/outputs/apk/app-mock-debug-androidTest.apk

Tag summary

Content type

Image

Digest

Size

1.5 GB

Last updated

about 6 years ago

docker pull megakrutak/gitlab-ci-android