Skip to content

Commit 5277ed9

Browse files
committed
add ci
1 parent 8110970 commit 5277ed9

File tree

3 files changed

+69
-0
lines changed

3 files changed

+69
-0
lines changed

.travis.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Based on the "trust" template v0.1.2
2+
# https://github.com/japaric/trust/tree/v0.1.2
3+
4+
dist: trusty
5+
language: rust
6+
services: docker
7+
8+
matrix:
9+
include:
10+
# Linux
11+
- env: TARGET=armv7-unknown-linux-gnueabihf
12+
rust: nightly
13+
- env: TARGET=x86_64-unknown-linux-gnu
14+
rust: nightly
15+
16+
before_install:
17+
- set -e
18+
- rustup self update
19+
20+
install:
21+
- bash ci/install.sh
22+
23+
script:
24+
- bash ci/script.sh
25+
26+
after_script: set +e
27+
28+
before_deploy:
29+
- sh ci/before_deploy.sh
30+
31+
cache: cargo
32+
before_cache:
33+
# Travis can't cache files that are not readable by "others"
34+
- chmod -R a+r $HOME/.cargo
35+
36+
branches:
37+
only:
38+
- auto
39+
- master
40+
- try
41+
42+
notifications:
43+
email:
44+
on_success: never

ci/install.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
set -ex
2+
3+
main() {
4+
# This fetches latest stable release of Cross
5+
local tag=$(git ls-remote --tags --refs --exit-code https://github.com/japaric/cross \
6+
| cut -d/ -f3 \
7+
| grep -E '^v[0.1.0-9.]+$' \
8+
| sort --version-sort \
9+
| tail -n1)
10+
11+
curl -LSfs https://japaric.github.io/trust/install.sh | \
12+
sh -s -- \
13+
--force \
14+
--git japaric/cross \
15+
--tag $tag
16+
}
17+
18+
main

ci/script.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# This script takes care of testing your crate
2+
3+
set -euxo pipefail
4+
5+
main() {
6+
cross check --target $TARGET
7+
}

0 commit comments

Comments
 (0)