Skip to content

Commit 66e7897

Browse files
committed
add CI
1 parent 4846488 commit 66e7897

File tree

4 files changed

+68
-0
lines changed

4 files changed

+68
-0
lines changed

.travis.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
language: rust
2+
3+
matrix:
4+
include:
5+
- env: TARGET=x86_64-unknown-linux-gnu
6+
rust: nightly
7+
8+
before_install: set -e
9+
10+
install:
11+
- bash ci/install.sh
12+
13+
script:
14+
- bash ci/script.sh
15+
16+
after_script: set +e
17+
18+
after_success:
19+
- bash ci/after_success.sh
20+
21+
cache: cargo
22+
before_cache:
23+
# Travis can't cache files that are not readable by "others"
24+
- chmod -R a+r $HOME/.cargo
25+
26+
branches:
27+
only:
28+
- auto
29+
- master
30+
- try
31+
32+
notifications:
33+
email:
34+
on_success: never

ci/after_success.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
set -euxo pipefail
2+
3+
main() {
4+
cargo doc --target $TARGET
5+
6+
mkdir ghp-import
7+
8+
curl -Ls https://github.com/davisp/ghp-import/archive/master.tar.gz | \
9+
tar --strip-components 1 -C ghp-import -xz
10+
11+
./ghp-import/ghp_import.py target/$TARGET/doc
12+
13+
set +x
14+
git push -fq https://$GH_TOKEN@github.com/$TRAVIS_REPO_SLUG.git gh-pages && \
15+
echo OK
16+
}
17+
18+
if [ $TRAVIS_BRANCH = master ]; then
19+
main
20+
fi

ci/install.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
set -euxo pipefail
2+
3+
main() {
4+
return
5+
}
6+
7+
main

ci/script.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
set -euxo pipefail
2+
3+
main() {
4+
cargo check --target $TARGET
5+
}
6+
7+
main

0 commit comments

Comments
 (0)