# Copyright (c) 2019 Ant Financial
#
# SPDX-License-Identifier: Apache-2.0
#

dist: bionic
os: linux
language: go
go: 1.14.4
env: target_branch=$TRAVIS_BRANCH

before_install:
  - git remote set-branches --add origin "${TRAVIS_BRANCH}"
  - git fetch
  - "ci/setup.sh"

# we use install to run check agent
# so that it is easy to skip for non-amd64 platform
install:
  - "ci/install_rust.sh"
  - export PATH=$PATH:"$HOME/.cargo/bin"
  - export RUST_AGENT=yes
  - make -C ${TRAVIS_BUILD_DIR}/src/agent
  - make -C ${TRAVIS_BUILD_DIR}/src/agent check

before_script:
  - "ci/install_go.sh"
  - "ci/install_vc.sh"
  - make -C ${TRAVIS_BUILD_DIR}/src/runtime
  - make -C ${TRAVIS_BUILD_DIR}/src/runtime test
  - sudo -E PATH=$PATH GOPATH=$GOPATH make -C ${TRAVIS_BUILD_DIR}/src/runtime test

script:
  - "ci/static-checks.sh"

jobs:
  include:
  - name: x86_64 test
    os: linux
  - name: ppc64le test
    os: linux-ppc64le
    install: skip
  allow_failures:
    - name: ppc64le test
  fast_finish: true
