Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Matthew Finkel
fenix
Commits
5fb4e999
Unverified
Commit
5fb4e999
authored
Jul 31, 2020
by
Matthew Finkel
Browse files
Bug 40002: Add GitLab CI
Pin CI builds to runners with 32GB of RAM to avoid OOM conditions.
parent
dc3f8958
Changes
1
Show whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
0 → 100644
View file @
5fb4e999
variables
:
DEBIAN_FRONTEND
:
noninteractive
ANDROID_CLI_TOOLS
:
"
6609375"
ANDROID_CLI_TOOLS_DIGEST
:
"
89f308315e041c93a37a79e0627c47f21d5c5edbe5e80ea8dc0aac8a649e0e92"
ANDROID_COMPILE_SDK
:
"
28"
ANDROID_BUILD_TOOLS
:
"
28.0.3"
MAVEN_REPOSITORIES
:
"
${CI_PROJECT_DIR}/gradle_storage"
GRADLE_MAVEN_REPOSITORIES
:
"
file://${MAVEN_REPOSITORIES}"
default
:
# See https://about.gitlab.com/blog/2018/10/24/setting-up-gitlab-ci-for-android-projects/
# https://github.com/docker-library/openjdk/blob/master/8/jdk/buster/Dockerfile
image
:
openjdk:8-jdk
tags
:
-
32GB
before_script
:
# Prepare our Debian environment.
-
apt-get update -qq
-
apt-get upgrade -qy
# Install needed packages from Debian.
-
apt-get install -qy --fix-missing wget tar unzip lib32stdc++6 lib32z1 bzip2
#- ./taskcluster/scripts/toolchain/android-gradle-dependencies.sh
# Install the Android SDK Tools.
-
wget --quiet --output-document=android-cli-tools.zip https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_CLI_TOOLS}_latest.zip
-
echo "${ANDROID_CLI_TOOLS_DIGEST} android-cli-tools.zip" | sha256sum -c
-
unzip -qd cmdline-tools android-cli-tools.zip
-
echo y | cmdline-tools/tools/bin/sdkmanager --install "platforms;android-${ANDROID_COMPILE_SDK}" > /dev/null
-
echo y | cmdline-tools/tools/bin/sdkmanager --install "platform-tools" > /dev/null
-
echo y | cmdline-tools/tools/bin/sdkmanager --install "build-tools;${ANDROID_BUILD_TOOLS}" > /dev/null
# Install the Android NDK.
-
echo y | cmdline-tools/tools/bin/sdkmanager ndk-bundle > /dev/null
# Accept all the licenses.
-
set +o pipefail
-
yes | cmdline-tools/tools/bin/sdkmanager --licenses > /dev/null
-
set -o pipefail
# Create local.properties file.
-
echo "sdk.dir=$PWD" > local.properties
stages
:
-
build
-
buildFenixProduction
-
buildFennecBeta
-
buildFennecProduction
-
test
buildDebug
:
stage
:
build
script
:
-
./gradlew clean app:assembleDebug --stacktrace
# Disable for now.
#artifacts:
# paths:
# - app/build/outputs/apk/geckoBeta/debug/*.apk
# expire_in: 1 day
testLight
:
stage
:
test
script
:
# from config/pre-push-recommended.sh
# `tee` into a log file because resulting output is larger than 4 MB
# (4 MB is max log size)
-
./gradlew ktlint detekt assembleDebug assembleDebugAndroidTest testDebug | tee testLight_gradle.log
artifacts
:
paths
:
-
testLight_gradle.log
expire_in
:
1 day
when
:
always
#### Scheduled Jobs (build* stages run serially) ###
buildFenixProduction
:
stage
:
buildFenixProduction
only
:
-
schedules
script
:
-
./gradlew clean app:assembleNightly --stacktrace
buildFennecBeta
:
stage
:
buildFennecBeta
only
:
-
schedules
script
:
-
./gradlew clean app:assembleBeta --stacktrace
buildFennecProduction
:
stage
:
buildFennecProduction
only
:
-
schedules
script
:
-
./gradlew clean app:assembleRelease --stacktrace
testAll
:
stage
:
test
only
:
-
schedules
script
:
-
./gradlew clean test
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment