Skip to content

Commit 6e80d1a

Browse files
authored
Merge pull request #33 from kngwyu/travis
Change CI service to travis
2 parents 00f0ec9 + ff143e5 commit 6e80d1a

File tree

4 files changed

+87
-21
lines changed

4 files changed

+87
-21
lines changed

.travis.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
sudo: required
2+
dist: trusty
3+
language: python
4+
5+
cache:
6+
pip: true
7+
directories:
8+
- "$HOME/.cargo"
9+
10+
matrix:
11+
include:
12+
- python: "3.5"
13+
- python: "3.6"
14+
15+
env:
16+
global:
17+
- TRAVIS_RUST_VERSION=nightly
18+
- RUST_BACKTRACE=1
19+
- FEATURES=python3
20+
21+
addons:
22+
apt:
23+
packages:
24+
- libcurl4-openssl-dev
25+
- libelf-dev
26+
- libdw-dev
27+
- cmake
28+
- gcc
29+
- binutils-dev
30+
- libiberty-dev
31+
32+
before_install:
33+
- source ./ci/travis/setup.sh
34+
35+
install:
36+
- pip install -r ./example/requirements.txt
37+
38+
script:
39+
- ./ci/travis/test.sh

ci/travis/setup.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
# Find the installed version of a binary, if any
6+
_installed() {
7+
VERSION=$($@ --version 2>/dev/null || echo "$@ none")
8+
echo $VERSION | rev | cut -d' ' -f1 | rev
9+
}
10+
11+
# Find the latest available version of a binary on `crates.io`
12+
_latest() {
13+
VERSION=$(cargo search -q "$@" | grep "$@" | cut -f2 -d"\"")
14+
echo $VERSION
15+
}
16+
17+
### Setup Rust toolchain #######################################################
18+
curl -SsL "https://sh.rustup.rs/" | sh -s -- -y --default-toolchain=$TRAVIS_RUST_VERSION
19+
export PATH=$PATH:$HOME/.cargo/bin
20+
21+
### Setup python linker flags ##################################################
22+
23+
python -c """
24+
import sysconfig
25+
cfg = sorted(sysconfig.get_config_vars().items())
26+
print('\n'.join(['{}={}'.format(*x) for x in cfg]))
27+
"""
28+
29+
export PYTHON_LIB=$(python -c "import sysconfig as s; print(s.get_config_var('LIBDIR'))")
30+
31+
# find $PYTHON_LIB
32+
export LIBRARY_PATH="$LIBRARY_PATH:$PYTHON_LIB"
33+
34+
# delete any possible empty components
35+
# https://github.com/google/pulldown-cmark/issues/122#issuecomment-364948741
36+
LIBRARY_PATH=$(echo $LIBRARY_PATH | sed -E -e 's/^:*//' -e 's/:*$//' -e 's/:+/:/g')
37+
38+
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PYTHON_LIB:$HOME/rust/lib"

ci/travis/test.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
3+
set -ex
4+
5+
cargo build --verbose --all
6+
cargo test --verbose --all
7+
8+
cd example
9+
python setup.py install
10+
python setup.py test

wercker.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)