mamba 0.3.0

A transpiler which converts Mamba files to Python 3 files
Documentation
os:
  - osx
  - linux

language: rust
rust:
  - nightly

dist: xenial
python:
  - "3.8"

# cache dependencies
before_cache:
  - if [ $TRAVIS_OS_NAME = 'osx' ]; then brew cleanup; fi

cache:
  directories:
    - if [ $TRAVIS_OS_NAME = 'osx' ]; then $HOME/Library/Caches/Homebrew; fi

sudo: true

addons:
  apt:
    packages:
      - libcurl4-openssl-dev
      - libelf-dev
      - libdw-dev
      - cmake
      - gcc
      - binutils-dev

before_script:
  # Cargo components
  - if [ $TRAVIS_RUST_VERSION = 'nightly' AND $TRAVIS_OS_NAME = 'linux' ]; then rustup component add rustfmt --toolchain nightly; fi
  - if [ $TRAVIS_RUST_VERSION = 'stable' AND $TRAVIS_OS_NAME = 'linux' ]; then rustup component add clippy; fi
  - if [ $TRAVIS_RUST_VERSION = 'nightly' AND $TRAVIS_OS_NAME = 'linux' ]; then rustup component add clippy --toolchain nightly; fi

before_install:
  # Python
  - python3 --version
  - |

    if [ $TRAVIS_OS_NAME = 'linux' ]; then
      sudo apt update;
      sudo apt install software-properties-common;
      sudo add-apt-repository -y ppa:deadsnakes/ppa;
      sudo apt-get update;
      sudo apt-get install python3.8;
      curl -L https://github.com/mozilla/grcov/releases/latest/download/grcov-linux-x86_64.tar.bz2 | tar jxf -;
    fi
  - python3 --version

after_success:
  # Coverage report
  - if [ $TRAVIS_RUST_VERSION = 'nightly' AND $TRAVIS_OS_NAME = 'linux' ]; then bash <(curl -s https://codecov.io/bash); fi

script:
  - if [ $TRAVIS_RUST_VERSION = 'stable' AND $TRAVIS_OS_NAME = 'linux' ]; then cargo clippy -- -D warnings; fi
  - if [ $TRAVIS_RUST_VERSION = 'nightly' AND $TRAVIS_OS_NAME = 'linux' ]; then cargo +nightly clippy -- -D warnings; fi
  - if [ $TRAVIS_RUST_VERSION = 'nightly' AND $TRAVIS_OS_NAME = 'linux' ]; then cargo +nightly fmt --all -- --check; fi

  - |

    if [ $TRAVIS_RUST_VERSION = 'nightly' AND $TRAVIS_OS_NAME = 'linux' ]; then
      export CARGO_INCREMENTAL=0;
      export RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zno-landing-pads";
    fi

  - cargo build
  - cargo test

  - |

    if [ $TRAVIS_RUST_VERSION = 'nightly' AND $TRAVIS_OS_NAME = 'linux' ]; then
      zip -0 ccov.zip `find . \( -name "mamba*.gc*" \) -print`;
      ./grcov ccov.zip -s . -t lcov --llvm --branch --ignore-not-existing --ignore-dir "/*" lcov.info;
      bash <(curl -s https://codecov.io/bash) -f lcov.info;
    fi