Add cross build targeting Redox to Travis CI

This commit is contained in:
Ian Douglas Scott 2017-11-13 22:50:58 -08:00
parent 5f8c506a32
commit a23a8ed1f1
No known key found for this signature in database
GPG key ID: 4924E10E199B5959
3 changed files with 17 additions and 3 deletions

2
.cargo/config Normal file
View file

@ -0,0 +1,2 @@
[target.x86_64-unknown-redox]
linker = "x86_64-unknown-redox-gcc"

View file

@ -25,10 +25,15 @@ matrix:
- rust: nightly
os: osx
env: FEATURES=nightly
- rust: nightly
os: linux
env: FEATURES=nightly,redox CC=x86_64-unknown-redox-gcc CARGO_ARGS='--no-default-features --target=x86_64-unknown-redox' REDOX=1
cache:
directories:
- $HOME/.cargo
sudo: false
sudo: true
before_install:
- if [ $REDOX ]; then ./.travis/redox-toolchain.sh; fi
script:
- cargo build --features "$FEATURES"
- cargo test --features "$FEATURES" --no-fail-fast
- cargo build $CARGO_ARGS --features "$FEATURES"
- if [ ! $REDOX ]; then cargo test $CARGO_ARGS --features "$FEATURES" --no-fail-fast; fi

7
.travis/redox-toolchain.sh Executable file
View file

@ -0,0 +1,7 @@
#!/bin/bash
rustup target add x86_64-unknown-redox
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys AA12E97F0881517F
sudo add-apt-repository 'deb https://static.redox-os.org/toolchain/apt /'
sudo apt-get update -qq
sudo apt-get install -y x86-64-unknown-redox-gcc