Skip to content

Commit

Permalink
added prebuilt rust travis script
Browse files Browse the repository at this point in the history
  • Loading branch information
russnes committed Jun 16, 2019
1 parent 42c2a45 commit b7d76fa
Showing 1 changed file with 66 additions and 17 deletions.
83 changes: 66 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,73 @@
#os:
# - centos
env:
matrix:
- OS_TYPE=centos OS_VERSION=7
language: rust
rust:
- nightly
cache:
- apt
matrix:
include:
- env:
- NAME=server-coordinator
- TARGET=arm-unknown-linux-gnueabihf
- LINKER=arm-linux-gnueabihf-gcc
- PACKAGE=$NAME-rpi2.tar.gz
addons:
apt:
packages: &armhf
- gcc-arm-linux-gnueabihf
- libc6-armhf-cross
- libc6-dev-armhf-cross
- env:
- NAME=server-coordinator
- TARGET=armv7-unknown-linux-gnueabihf
- LINKER=arm-linux-gnueabihf-gcc
- PACKAGE=$NAME-rpi3.tar.gz
addons:
apt:
packages: *armhf
- env:
- NAME=server-coordinator
- TARGET=i686-unknown-linux-gnu
- PACKAGE=$NAME-i686.tar.gz
addons:
apt:
packages:
- gcc-multilib
- env:
- NAME=server-coordinator
- TARGET=x86_64-unknown-linux-gnu
- PACKAGE=$NAME-x86_64.tar.gz

install:
- export PATH="$PATH:$HOME/.cargo/bin"
- rustup target add $TARGET || true
- |
if [ -n "$LINKER" ]; then
mkdir -p ~/.cargo
echo >> ~/.cargo/config
echo "[target.$TARGET]" >> ~/.cargo/config
echo "linker = \"$LINKER\"" >> ~/.cargo/config
fi
script:
- |
if [ $TARGET = "x86_64-unknown-linux-gnu" ]; then
cargo test
fi
- cargo build --target $TARGET --verbose --release

before_deploy:
- tar -czf $PACKAGE -C target/$TARGET/release/ $NAME

deploy:
deploy:
provider: releases
api_key:
secure: $GITHUB_TOKEN
file: ${PACKAGE}
skip_cleanup: true
github_token: $GITHUB_TOKEN # Set in the settings page of your repository, as a secure variable
keep_history: true
file: server-coordinator
on:
repo: simernes/server-coordinator
branch: master

language: rust
rust:
- stable
- beta
- nightly
matrix:
allow_failures:
- rust: nightly
fast_finish: true
cache: cargo
tags: true
repo: simernes/server-coordinator

0 comments on commit b7d76fa

Please sign in to comment.