pyo3/.travis.yml

79 lines
2.8 KiB
YAML
Raw Normal View History

2015-06-28 19:46:24 +00:00
language: python
python:
2017-06-12 05:23:49 +00:00
- "2.7"
2015-09-13 17:49:09 +00:00
- "3.5"
2017-01-18 20:28:04 +00:00
- "3.6"
2017-06-12 01:30:56 +00:00
2015-04-19 03:21:28 +00:00
env:
2017-11-27 19:04:49 +00:00
global:
2017-11-27 19:06:53 +00:00
- RUST_VERSION=nightly
2017-11-27 19:04:49 +00:00
- RUSTFLAGS="-C link-dead-code"
2017-05-21 05:24:30 +00:00
sudo: required
dist: trusty
2017-06-15 16:11:19 +00:00
2017-11-27 19:04:49 +00:00
addons:
apt:
packages:
- libcurl4-openssl-dev
- libelf-dev
- libdw-dev
- cmake
- gcc
- binutils-dev
- libiberty-dev
2017-06-15 16:11:19 +00:00
# Add clippy
before_script:
- |
if [[ "$TRAVIS_RUST_VERSION" == "nightly" ]]; then
( ( cargo install clippy && export CLIPPY=true ) || export CLIPPY=false );
fi
- export PATH=$PATH:~/.cargo/bin
2015-06-28 19:46:24 +00:00
install:
- python -c "import sysconfig; print('\n'.join(map(repr,sorted(sysconfig.get_config_vars().items()))))"
2015-06-28 19:46:24 +00:00
- mkdir ~/rust-installer
- curl -sL https://static.rust-lang.org/rustup.sh -o ~/rust-installer/rustup.sh
2017-05-19 18:48:05 +00:00
- sh ~/rust-installer/rustup.sh --prefix=~/rust --spec=$RUST_VERSION -y
2015-06-28 19:46:24 +00:00
- export PATH="$HOME/rust/bin:$PATH"
2017-12-19 03:40:45 +00:00
- python -c "import sysconfig; print(sysconfig.get_config_var('LIBDIR'))"
2015-06-28 19:46:24 +00:00
- export PYTHON_LIB=$(python -c "import sysconfig; print(sysconfig.get_config_var('LIBDIR'))")
2017-12-19 03:40:45 +00:00
# - find $PYTHON_LIB
2015-06-28 19:46:24 +00:00
- export LIBRARY_PATH="$LIBRARY_PATH:$PYTHON_LIB"
- export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PYTHON_LIB:$HOME/rust/lib"
- rustc -V
2015-04-19 04:32:59 +00:00
script:
2017-05-13 06:01:54 +00:00
- make test
2017-06-15 16:11:19 +00:00
# - make clippy
# Upload docs
after_success:
2017-06-15 18:13:58 +00:00
- |
2017-06-15 22:33:06 +00:00
if [[ "$TRAVIS_OS_NAME" == "linux" && "$TRAVIS_PULL_REQUEST" = "false" && "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PYTHON_VERSION" == "3.6" ]]; then
2017-06-15 18:13:58 +00:00
cargo doc --no-deps &&
echo "<meta http-equiv=refresh content=0;url=os_balloon/index.html>" > target/doc/index.html &&
cargo install mdbook &&
cd guide && mdbook build -d ../target/doc/guide && cd .. &&
2017-06-15 18:13:58 +00:00
git clone https://github.com/davisp/ghp-import.git &&
2017-06-15 18:20:40 +00:00
./ghp-import/ghp_import.py -n -p -f -m "Documentation upload" -r https://"$GH_TOKEN"@github.com/"$TRAVIS_REPO_SLUG.git" target/doc &&
2017-06-15 18:13:58 +00:00
echo "Uploaded documentation"
2017-06-15 16:11:19 +00:00
fi
2017-11-27 19:04:49 +00:00
2017-11-27 19:19:22 +00:00
if [[ "$TRAVIS_OS_NAME" == "linux" && "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PYTHON_VERSION" == "3.6" ]]; then
2017-11-27 19:04:49 +00:00
wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz &&
tar xzf master.tar.gz &&
cd kcov-master &&
mkdir build &&
cd build &&
cmake .. &&
make &&
make install DESTDIR=../../kcov-build &&
cd ../.. &&
rm -rf kcov-master &&
for file in target/debug/pyo3-*[^\.d]; do mkdir -p "target/cov/$(basename $file)"; ./kcov-build/usr/local/bin/kcov --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/$(basename $file)" "$file"; done &&
for file in target/debug/test_*[^\.d]; do mkdir -p "target/cov/$(basename $file)"; ./kcov-build/usr/local/bin/kcov --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/$(basename $file)" "$file"; done &&
bash <(curl -s https://codecov.io/bash) &&
echo "Uploaded code coverage"
fi