-
Notifications
You must be signed in to change notification settings - Fork 20
/
.travis.yml
160 lines (147 loc) · 4.5 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
language: rust
env:
global:
- PROJECT_NAME: offset
- RUST_BACKTRACE: full
git:
depth: 1
# Don't cache the cargo registry:
# See: https://levans.fr/rust_travis_cache.html
before_cache:
- ci/post/cargo-sweep.sh
- rm -rf $HOME/.cargo/registry
cache:
directories:
- $HOME/.cargo
- $HOME/install
# Android SDK
- $HOME/android-sdk-dl
- $HOME/android-sdk
jobs:
fast_finish: true
include:
- name: x86_64-unknown-linux-gnu
env: TARGET=x86_64-unknown-linux-gnu
os: linux
dist: bionic
addons:
apt:
packages:
- gcc-6
- g++-6
sources:
- ubuntu-toolchain-r-test
install:
# Fix according to https://github.com/codecov/codecov-bash/issues/94#issuecomment-349216688
- pip install --user codecov
script:
# Add clippy and rustfmt:
- rustup update
- rustup component add clippy rustfmt
# Install capnp:
- ci/pre/capnp.sh
# Check formatting:
- cargo fmt --all -- --check
# Run clippy check:
- cargo clippy
# We add target dir so that kcov can find the test files to run:
- RUSTFLAGS="-C link-dead-code" cargo test --target ${TARGET}
- ci/post/kcov/try-install.sh
- ci/post/kcov/run.sh
# https://github.com/RustSec/cargo-audit
# Check for known vulnerabilities and issues in dependencies tree.
- name: cargo-audit
before_script:
- cargo install --force cargo-audit
- cargo generate-lockfile
script:
- cargo audit
- name: x86_64-apple-darwin
env: TARGET=x86_64-apple-darwin
os: osx
osx_image: xcode11.3
# Solution due to https://travis-ci.community/t/homebrew-syntax-error/5623 :
before_script:
- HOMEBREW_NO_AUTO_UPDATE=1 brew install capnp
script:
- cargo test
- name: x86_64-pc-windows-msvc
env: TARGET=x86_64-pc-windows-msvc
os: windows
# Used as a temporary fix for windows CI issue in travis.
# See: https://travis-ci.community/t/windows-instances-hanging-before-install/250/25
filter_secrets: false
before_script:
- choco install capnproto
- rustup target add x86_64-pc-windows-msvc
script:
- cargo test
# Based on: https://github.com/kennytm/rust-ios-android/blob/master/.travis.yml
- name: aarch64-linux-android
env: TARGET="aarch64-linux-android"
os: linux
dist: bionic
addons:
apt:
packages:
- gcc-6
- g++-6
sources:
- ubuntu-toolchain-r-test
before_install:
- source ./ci/android_before_install.sh
install:
- ./ci/android_install.sh
script:
- cargo build --target ${TARGET}
- name: armv7-linux-androideabi
env: TARGET="armv7-linux-androideabi"
os: linux
dist: bionic
addons:
apt:
packages:
- gcc-6
- g++-6
sources:
- ubuntu-toolchain-r-test
before_install:
- source ./ci/android_before_install.sh
install:
- ./ci/android_install.sh
script:
- cargo build --target ${TARGET}
- name: i686-linux-android
env: TARGET="i686-linux-android"
os: linux
dist: bionic
addons:
apt:
packages:
- gcc-6
- g++-6
sources:
- ubuntu-toolchain-r-test
before_install:
- source ./ci/android_before_install.sh
install:
- ./ci/android_install.sh
script:
- cargo build --target ${TARGET}
before_deploy: ci/before_deploy.sh
deploy:
provider: releases
token:
secure: MpKcz5y3DQGkZYpekopOAHkErw8RoJSsnLDWzTQg+bxDD4+30Q+aZ21EK6BIvOgNTcGZCpxKAr1iobr9IVv9tlEZVGeV3eiCeAUCq52uQmDfYf5VkckwF5DLBcKN7FLZZVgKq8m30OLXDyxuwogd39LcKzTKyHURQAa7DHSjomUf+Yu+/+PFMxCisvFKl0Etp/qMbPXuoZya19qH5zDNupf4BsB00qJo0SMF8pPZ/p+m+BGotBNNwLWGrfDt5Pv460/0H8MixkrVnt3/tKmZ3MvhQ42bMgMR5vg+j/Ioeiq2jiUjoLaC0HixL8wyOKyiXiuvAE812P5MEeCA6RrjG2q6CaOM+b4+Az5q/PbM5zzmhjT6wWVmNfIb7hqin7k63cAL5BBAmqcWO9LYazk3/8Eqv+/CVGvZyVixz7/qhbBzA/J5sJiu4O5IHYgtchXUcyZh+YIPwQpfwbHhyUl55wIRqMiOohaBxufYBKGUoe5pH26U/acaY4xSzRKCbXTej5bW+pY3OkeUKZFEETDAPdGcGjrD12CFbSaY5ikYmkFSDKluMcbvXpWCRXvPo+D+c1RPJ6xxxYKA/+6AH3nhQEwX6viEYD/XtxPYUEdbgYcImz/HL5clo6j0uiP/gHmrdGY+tg8btOozNvkNXMKJyEffYMFyuDbPrjWOK712/pU=
file: $HOME/deployment/${PROJECT_NAME}-${TRAVIS_TAG}-${TARGET}.tar.gz
on:
tags: true
repo: freedomlayer/offset
branch: master
branches:
only:
# Pushes and PR to the master branch
- master
# Ruby regex to match tags. Required, or travis won't trigger deploys when
# a new tag is pushed. Version tags should be of the form: v0.1.0
- /^v\d+\.\d+\.\d+.*$/