blob: 9fbcf8c9e3e762adc5045a7a845a0d6369f2ccfd [file] [log] [blame]
language: android
os: linux
dist: trusty
sudo: required
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- libstdc++-4.9-dev # https://github.com/nodegit/nodegit/issues/853
- gcc-4.8
- g++-4.8
jdk:
- &jdk_for_publishing oraclejdk8
android:
components:
- tools
- platform-tools
- tools # Duplicated as per https://github.com/travis-ci/travis-ci/issues/6040#issuecomment-219367943
- extra-android-m2repository
before_install:
- yes | sdkmanager "build-tools;30.0.2"
- yes | sdkmanager "platforms;android-30"
- wget https://github.com/bazelbuild/bazel/releases/download/"${BAZEL_VERSION}"/bazel_"${BAZEL_VERSION}"-linux-x86_64.deb
- sudo dpkg -i bazel_"${BAZEL_VERSION}"-linux-x86_64.deb
- sudo rm -f /etc/mavenrc
- wget http://www.us.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz
- tar -zxf apache-maven-3.6.3-bin.tar.gz
- export PATH="$PWD/apache-maven-3.6.3/bin:$PATH"
- mkdir travis_bin
- ln -s $(which gcc-4.8) travis_bin/gcc
- ln -s $(which g++-4.8) travis_bin/g++
- export PATH="${PWD}/travis_bin:${PATH}"
# These jobs should match util/run-local-tests.sh. We can't run that script
# directly since it's too slow for a single job.
jobs:
include:
- stage: "Bazel tests"
name: "Bazel tests"
# A travis_fold makes the output of the script foldable.
script:
- travis_fold start "script.1" &&
bazel test --test_output=errors //... &&
travis_fold end "script.1"
- travis_fold start "script.2" &&
util/install-local-snapshot.sh &&
travis_fold end "script.2"
# A cache shares data between separate build runs on the same branch.
# https://docs.travis-ci.com/user/caching/
cache:
directories:
- $HOME/.cache/bazel
# A workspace shares data between separate stages of the same build run.
# https://docs.travis-ci.com/user/build-stages/
workspaces:
create:
name: dagger_artifacts
paths: $HOME/.m2/repository/com/google/dagger
- stage: "Artifact tests"
name: "Maven tests"
script: pushd examples/maven && mvn compile && popd
workspaces:
use: dagger_artifacts
- name: "Gradle tests"
script: util/run-local-gradle-tests.sh
workspaces:
use: dagger_artifacts
- name: "Gradle Android tests (AGP 4.1.0)"
script: util/run-local-gradle-android-tests.sh "4.1.0"
workspaces:
use: dagger_artifacts
- name: "Gradle Android tests (AGP 4.2.0-beta01)"
script: util/run-local-gradle-android-tests.sh "4.2.0-beta01"
workspaces:
use: dagger_artifacts
- stage: "Publish"
name: "Publish latest docs"
script: util/generate-latest-docs.sh
cache:
directories:
- $HOME/.cache/bazel
- name: "Publish latest snapshot"
script: util/publish-snapshot-on-commit.sh
cache:
directories:
- $HOME/.cache/bazel
# Order the stages and conditionally exclude stages
stages:
- "Bazel tests"
- "Artifact tests"
- name: "Publish"
if: type != pull_request
env:
global:
# Encrypted credentials for deploying snapshots.
- secure: SV7y/nx47vwCCFJgyhZjlyC9tUneUpwe5XhEMLlj9oOpQRr4eqDumybZtKpKaxdtv13NMQ5rI9coWdO9L4TVjrJXAfG2rWoi7nXh8z0gDESVZLmCtiLPlC5zkAAur9X/6gIau5IizyliDVp7jrAI0f6Ywdd4FHcXl7t8laUzVWg=
- secure: P53TirBuYomoOqVTVnDb5Z7xc5qa5KICbkDCAdlo+Nwyb6be6Mr3rxJ0ozR201UpmCdOhGvvVpILTkakC0iF6nJc4gYjOoR95u9gNKWAsRE1tlvR4FX7o7n7aDyizaAyQXUFo5wWtLANHDvLUuf5du3xryMKJw1r9/oOpLxs+T0=
# Encrypted GitHub access token to allow util/generate-latest-docs.sh to
# push Javadoc to gh-pages.
# This uses an access token created by cgdecker and will need to be updated
# (see util/generate-latest-docs.sh for a link) if he no longer has
# permission to push to the repo.
- secure: "UpTUhCQzAGbr5JetRg2GZxp/dPDep/7Il3yGeyDECopciWdx41OPk/QNqAXBhNtKuEaMVsmASyoteuhgaTryQdV4qUIGVOMhES6kbOlYy3nwK44VdsNeeepwVospyDyZbxMtXq5LuHWuTADmAl1mdjNPNoziXc523zjnUzUx/EQ="
- JDK_FOR_PUBLISHING: *jdk_for_publishing
- BAZEL_VERSION="3.7.1"
- ADB_INSTALL_TIMEOUT=10
branches:
only:
- master
- /^release.*$/