changeset 62:ce9f8785cc88

Add travis CI configuration
author Lewin Bormann <lbo@spheniscida.de>
date Sun, 16 Feb 2020 21:04:17 +0100
parents bb03769a5cef
children b059e13e867a
files .travis.yml
diffstat 1 files changed, 59 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.travis.yml	Sun Feb 16 21:04:17 2020 +0100
@@ -0,0 +1,59 @@
+os:
+  - linux
+  - osx
+dist: bionic
+sudo: false
+addons:
+  apt:
+    packages:
+      # necessary for kcov
+      - libcurl4-openssl-dev
+      - libelf-dev
+      - libdw-dev
+      - libiberty-dev
+      - binutils-dev
+      - cmake
+      - gcc
+
+language: rust
+rust:
+  - stable
+  - nightly
+
+stages:
+  - name: test
+  - name: lint
+  - name: coverage
+
+install: true
+
+# Default script is the "test" stage
+script: 
+  - cargo build
+  - cargo test
+
+jobs:
+  include:
+    - stage: lint
+      if: os = linux
+      rust: stable
+      install:
+        - rustup component add rustfmt
+      script:
+        - cargo fmt --all -- --check
+
+    - stage: coverage
+      if: os = linux
+      sudo: true
+      rust: stable
+      env:
+        - RUSTFLAGS="-C link-dead-code -C debuginfo=2 -C opt-level=0"
+        - CACHE_NAME="coverage"
+      install:
+        - ./.travis/install-kcov.sh "v36" "29ccdde3bd44f14e0d7c88d709e1e5ff9b448e735538ae45ee08b73c19a2ea0b" && export PATH="kcov/usr/bin:${PATH}";
+      script:
+        - cargo test --no-run
+        - ./.travis/run-kcov.sh "yup_oauth2"
+        - bash <(curl -s https://codecov.io/bash) -F "${TRAVIS_RUST_VERSION}"
+
+cache: cargo