time-util 0.3.4

A crate providing miscellaneous functionality for working with time stamps.
Documentation
# The documentation for the contents of this file can be found at:
# https://docs.gitlab.com/ce/ci/yaml/README.html

# Official language image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/rust/tags/
# The recipe for this docker image can be found at:
# https://github.com/rust-lang/docker-rust/blob/8d0f25416858e2c1f59511a15c2bd0445b402caa/1.39.0/stretch/Dockerfile
image: "rust:1.39.0"

stages:
  - build
  - test

build:cargo:
  stage: build
  artifacts:
    paths:
      - target/
  script:
  - rustc --version && cargo --version
  # We don't quite build every combination, but at least check the main
  # features stand alone.
  - cargo build --lib --tests --verbose --features=math
  - cargo build --lib --tests --verbose --features=math --release
  - cargo build --lib --tests --verbose --features=chrono
  - cargo build --lib --tests --verbose --features=chrono --release
  - cargo build --lib --tests --verbose --features=serde
  - cargo build --lib --tests --verbose --features=serde --release
  - cargo build --lib --tests --verbose --all-features
  - cargo build --lib --tests --verbose --all-features --release

test:cargo:
  stage: test
  dependencies:
  - build:cargo
  script:
  - cargo test --all-features --verbose

lint:clippy:
  stage: test
  dependencies:
    - build:cargo
  script:
  - rustup component add clippy
  - cargo clippy --all-targets --all-features -- -D warnings

coverage:kcov:
  # Only executed on master because we keep artifacts around forever.
  #only:
  #- master
  stage: test
  dependencies:
    - build:cargo
  artifacts:
    expire_in: never
    paths:
    - kcov/
  coverage: '/^Coverage+:\s(\d+(?:\.\d+)?)/'
  script:
  - echo 'deb http://deb.debian.org/debian testing main' >> /etc/apt/sources.list
  - echo 'deb http://deb.debian.org/debian unstable main' >> /etc/apt/sources.list
  - apt-get update
  - apt-get install --assume-yes kcov
  - files=$(find target/debug -maxdepth 1 -type f -executable -iname "*-????????????????");
    covs="";
    for file in ${files}; do
      cov="kcov-$(basename ${file})";
      kcov --exclude-pattern="target/" --verify "${cov}" "${file}";
      covs+=" ${cov}";
    done;
    kcov --merge kcov/ ${covs};
    COVERAGE=$(grep --only-matching 'covered":"[^"]\+"' kcov/index.js | awk -F'"' '{print $3}');
    echo "Coverage:" ${COVERAGE};