-
Notifications
You must be signed in to change notification settings - Fork 13
/
.travis.yml
94 lines (87 loc) · 2.49 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
language: rust
# pyo3 currently is only supported by the nightly version
rust:
- nightly
# Cache cargo symbols for faster build
cache: cargo
env:
- RUST_BACKTRACE=full
# In future we could also add windows testing
jobs:
include:
- os: linux
dist: bionic
- os: osx
osx_image: "xcode11.5"
- os: windows
before_install:
- choco install python --version 3.7.0
- python -m pip install --upgrade pip
env: PATH=/c/Python37:/c/Python37/Scripts:$PATH
# Dependencies of kcov, used by coverage
addons:
apt:
packages:
- libiberty-dev
- zlib1g-dev
- libcurl4-openssl-dev
- libelf-dev
- libdw-dev
- binutils-dev
- gcc
- cmake # also required for cargo-update
- python3
- python3-pip
- python3-setuptools
- musl-tools
before_script:
- export PATH=$HOME/.cargo/bin:$PATH
- cargo install cargo-update || echo "cargo-update already installed"
- cargo install-update -a # update outdated cached binaries
- |
if [ "$TRAVIS_OS_NAME" = "windows" ]; then
python -m pip install maturin pytest coveralls
python -m pip install -r ./bindings/python/requirements.txt
else
python3 -m pip install maturin pytest coveralls
python3 -m pip install -r ./bindings/python/requirements.txt
fi
# the main build
script:
# Build, test, bench the graph crate
- cargo update --verbose --manifest-path=graph/Cargo.toml
- cargo build --verbose --all --manifest-path=graph/Cargo.toml
- cargo test --verbose --all --manifest-path=graph/Cargo.toml
# move to the folder with the python bindings
- cd ./bindings/python
# Clearing up target directory
- rm -fdr target
# Build the bindings
- cargo update
- maturin build --release
- |
if [ "$TRAVIS_OS_NAME" = "windows" ]; then
# Install the binding
python -m pip install --user --upgrade ./target/wheels/*.whl
# Run the python tests
cd pytests
python -m pytest -s ./pytests
cd ..
else
# Install the binding
python3 -m pip install --user --upgrade ./target/wheels/*.whl
# Run the python tests
cd pytests
python3 -m pytest -s ./pytests
cd ..
fi
after_success:
- |
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
git clone https://github.com/SimonKagstrom/kcov.git
cd kcov
mkdir build; cd build; cmake ..; make -j4; sudo make install
cd ../..
cd ./graph && bash coverage.sh
bash <(curl -s https://codecov.io/bash)
fi