How to set up Travis CI with multiple languages

It seems to be possible now to run several languages in one .travis.yml file using the jobs:include feature. As an example, my Github repo is arranged as follows:

project/ - top-level github directory
project/backend - Python backend
project/backend/tests - Python tests
project/android/AppName - Android app
project/ios/AppName - iOS app

Here is the .travis.yml, which runs tests in Python, Java, and Objective-C:

jobs:
  include:
    - language: python
      python: 2.7
      before_script:
        - cd backend/tests
      script:
        - python -m unittest discover

    - language: android
      dist: trusty
      jdk: oraclejdk8
      android:
        components:
          - tools
          - android-25
          - build-tools-25.0.3
      before_script:
        - cd android/AppName
      script:
        - ./gradlew build connectedCheck

    - language: objective-c
      os: osx
      osx_image: xcode8.3
      before_script:
        - cd ios/AppName
      script:
        - xcodebuild -workspace AppName.xcworkspace -scheme AppName
          -destination 'platform=iOS Simulator,name=iPhone 7,OS=10.3' build test

notifications:
  email:
    - yourname@gmail.com

It seems you can build as many different configurations as you like using this feature, by treating each entry in the matrix as a top level config. Of course, if you have any parameters you want to set that apply to all languages, you can do that at the top level, as I do here with the notifications:email section.

When it is all set up, then on each build, you get something like this. Boom.

enter image description here

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)