Giter Site home page Giter Site logo

ffflorian / docker-android Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fabernovel/docker-android

0.0 0.0 0.0 473 KB

docker-android provides general purpose docker images to run CI steps of Android project.

Shell 32.85% Ruby 7.21% C++ 0.81% Kotlin 41.86% CMake 5.08% Dockerfile 12.19%

docker-android's Introduction

docker-android

docker-android

Run test & large tests daily License: GPL v3 Release

docker-android provides general purpose docker images to run CI steps of Android project. Docker allows you to provide a replicable environment, which does not change with the host machine or the CI service. It should work out of the box on any CI/CD service providing docker support. The image is providing standard tools to build and test Android application:

CI/CD service support

CI/CD service Tested
GitHub Actions โœ…
GitLab CI โœ…
Circle CI ๐Ÿšง
Travis CI ๐Ÿšง

Fastlane first-class support

Images are built to have first class support for Fastlane. Ruby versions in normal maintenance mode are installed using rbenv. If you are using a Fastlane plugin which requires a native library:

  • Install it using apt-get update && apt-get -y install <lib> in your CI workflow.
  • Comment faberNovel#78 so that we can keep track of missing native libraries and add them to the next image version.

JDK support

Images support multiple JDK, using Jenv. The default JDK is JDK 17, but JDK 11 and 8 are also supported (i.e. use jenv global 1.8 to set JDK to verion 8). To choose a JDK, make sure the script executes on a bash shell, then use Jenv to set the desired version:

jobs:
  my_android_job:
    defaults:
      run:
        shell: bash

    steps:
      - name: Jenv
        run: |
          eval "$(jenv init -)"
          jenv global {VERSION}

๐Ÿ™ GitHub Workflow Sample

Github workflows can run inside Docker images using container attribute after runs-on:

name: GitHub Action sample

on:
  push:
    branches:
      - develop

jobs:
  my_android_job:
    runs-on: ubuntu-22.04 # Works also with self hosted runner supporting docker
    container:
      image: docker://fabernovel/android:api-29-v1.1.0

  steps:
    - name: Checkout
      uses: actions/[email protected]

    - name: Ruby Setup
      uses: ruby/setup-ruby@v1
      with:
        bundler-cache: true
      env:
        ImageOS: ubuntu20

    - name: Gradle cache
      uses: actions/cache@v3
      with:
        path: |
          /root/.gradle/caches
          /root/.gradle/wrapper
        key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
        restore-keys: |
          ${{ runner.os }}-gradle-

    - name: Fastlane
      run: bundle exec fastlane my_lane

You can also use the provided Github Action. However, caching won't work and you can expect longer build times. docker-android-tag should be one of the tags found in Fabernovel Hub Registry Tags:

name: GitHub Action sample

on:
  push:
    branches:
      - develop

jobs:
  my_android_job:
    runs-on: ubuntu-22.04 # Works also with self hosted runner supporting docker

  steps:
    - name: Checkout
      uses: actions/[email protected]

    - name: Exec fastlane
      uses: fabernovel/docker-android
      with:
        docker-android-tag: api-29-ndk-v1.1.0
        exec: |
          bundle install;
          bundle exec fastlane my_lane

๐Ÿ“ฆ Container Registry

docker-android images are hosted on DockerHub.

๐Ÿ”ค Naming

We provide stable and snapshot variants for latest Android API levels, including or not native SDK. We use the following tagging policy: API-NDK-GCLOUD-VERSION

  • API the Android API to use, like api-28, api-29
  • NDK is the presence or not of the Android NDK in the image
  • GCLOUD is the presence or not of the Google Cloud SDK in the image. (the gcloud sdk is needed for Firebase Test Lab for example).
  • VERSION is the image version. Check Versions

๐Ÿ”ข Versions

  • snapshot versions are build on each push on develop branch
  • Release versions v* on each GitHub Release

๐Ÿ“ Image description

Image description (software and their versions) is provided as md files.

โœ๏ธ Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

You can change image settings via its Dockerfile. You can build, test, and deploy image using ci_cd.sh script. You need to install docker first. All scripts must be POSIX compliants.

usage: ./ci_cd.sh [--android-api 29] [--build-tools "29.0.3"] [--build] [--test]
  --android-api <androidVersion> Use specific Android version from `sdkmanager --list`
  --build-tools <version>        Use specific build tools version
  --android-ndk                  Install Android NDK
  --gcloud                       Install Google Cloud SDK
  --ndk-version <version>        Install a specific Android NDK version from `sdkmanager --list`
  --build                        Build image
  --test                         Test image
  --large-test                   Run large tests on the image (Firebase Test Lab for example)
  --deploy                       Deploy image
  --desc                         Generate a .md file in /desc/ouput folder describing the builded image, on host machine

License

GNU GPLv3

docker-android's People

Contributors

vincentbrison avatar ferrandp avatar flolom avatar romaingf avatar sjcqs avatar angeloavv avatar nicolasygrand avatar perlun avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.