This repository has been archived by the owner on Sep 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.travis.yml
101 lines (93 loc) · 3.58 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
language: rust
os: linux
dist: xenial
osx_image: xcode10.2
# Caching strategy from https://levans.fr/rust_travis_cache.html
# We avoid using cache: cargo which blows up the cache.
cache:
- directories:
- "${HOME}/.cargo"
- "${HOME}/kcov/"
before_cache:
- "rm -rf ${HOME}/.cargo/registry"
addons:
apt:
packages:
# For building MUSL static builds on Linux.
- musl-tools
# packages for kcov
- cmake
- libcurl4-openssl-dev
- libelf-dev
- libdw-dev
- binutils-dev
sources:
- kalakris-cmake
homebrew:
packages:
- cmake
jobs:
fast_finish: true
allow_failures:
- rust: beta
- rust: nightly
include:
- os: linux
rust: nightly
env: TARGET=x86_64-unknown-linux-musl
- os: linux
rust: beta
env: TARGET=x86_64-unknown-linux-musl
- os: linux
rust: stable
env: TARGET=x86_64-unknown-linux-musl
- os: osx
rust: nightly
env: TARGET=x86_64-apple-darwin
- os: osx
rust: beta
env: TARGET=x86_64-apple-darwin
- os: osx
rust: stable
env: TARGET=x86_64-apple-darwin
before_script:
- rustup target add $TARGET
- export PATH=$HOME/.cargo/bin:$PATH
# Cargo install fails if a crate is already installed — which it will be if it was cached.
# It recommends to use `--force`, but that _always_ recompiles from scratch which takes ~5 minutes.
# FIXME: Follow https://github.com/rust-lang/cargo/issues/6667 for a WIP fix on Cargo for this.
- cargo install cargo-audit || echo "cargo-update already installed"
- cargo install cargo-travis || echo "cargo-travis already installed"
- rustup component add clippy
- rustup component add rustfmt
script:
- cargo build --target $TARGET --release
- cargo clippy --all-targets --all-features -- -D warnings
- cargo test --target $TARGET --release
- cargo fmt --all -- --check
- cargo audit
# Make a copy of the binary named nicely for the GitHub release, if needed.
- cp target/$TARGET/release/gitkv target/$TARGET/release/gitkv-$TARGET && chmod +x target/$TARGET/release/gitkv-$TARGET
after_success:
- test $TRAVIS_OS_NAME = "linux" && cargo coverage --target $TARGET --kcov-build-location "${HOME}/kcov/"
- test $TRAVIS_OS_NAME = "linux" && bash <(curl -s https://codecov.io/bash)
deploy:
# Push binaries to the GitHub release for this version.
- provider: releases
edge: true
token:
secure: YP0Ieo3OYZaBkvZ/kXIUzY3RW+1u3m7/HXuB89kKT7Bi+DZrmYrbFngLG/sypeDaQudflyqWEKdszuu1OKFhRFBeSHlpivKPphfn8ghRvfbCoABn5gcegNSLyx2k+zWSjPTo6H2dR+dOtg0d64pxTXD3GJhkIotoxR3ODYlWqtojuBGMpBtN8fxF3ofWGAUTe2Ix5VTnrfghSQwUHM86ERNOLivhOJoxTHNUGtU421q9TgS7rrE1xssydJ+Iemcti8zH3G+s0QHEytqJnxsSbWotiixx4JcY+qnZ8PtGbA2DVfoWokfCRPRh6XOHB27Jt8graiG/wnl/RI30FgbBWv2Y25rXXX0V6Ql/773EGzayV8oP9WkYSYrwfFov0/zzM+AaQdbLnjTXJ7JbfMJPSKT6j5bbgY8jTAubnIDzwhaUfy4Hq4gkofOOksTJ9ef09lklQctEb1ISx+V/+KGAXveGIsQq6g3ap7EjvlF+M1XD6VHotlVlA4Xd1Z+TR5+Ae2AXZwpjT53TmNT3BPFAAl4CLqbah/poo8/ML9t2X+SyA2o6TaW3sqSBA5l3sFLCQjN805sVM/tUMk8OBRHwBoW18zg9jfDj9vbuIO7oq0CP8AfcN/25/QX+7QfZ9lEvOCQSaXzKIN5ToOix35/wmJzL5af05cYjz1rYW1Un1B4=
file: target/$TARGET/release/gitkv-$TARGET
on:
rust: stable
tags: true
branch: /^v\d+\.\d+\.\d+.*$/
# Push Docker container to Docker Hub tagger for this version.
- provider: script
edge: true
script: ./docker/build.sh $TRAVIS_BRANCH $TARGET && docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD" && docker push intenthq/gitkv:$TRAVIS_BRANCH
on:
condition: $TRAVIS_OS_NAME = "linux"
rust: stable
tags: true
branch: /^v\d+\.\d+\.\d+.*$/