forked from mayadata-io/cstor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
88 lines (88 loc) · 3.19 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
language: c
sudo: required
branches:
only:
- zfs-0.7-release
- /^\d+\.\d+(\.\d+)?(-\S*)?$/
- /^v\d+\.\d+(\.\S*)?$/
env:
global:
# Travis limits maximum log size, we have to cut tests output
- CODECOV_TOKEN="987cf0f1-ae3b-477e-b645-954e682f99ec"
- ZFS_TEST_TRAVIS_LOG_MAX_LENGTH=800
matrix:
# tags are mainly in ascending order
- ZFS_BUILD_TAGS=0
- ZFS_BUILD_TAGS=1
before_install:
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get update -qq
- sudo apt-get install --yes -qq gcc-6 g++-6
- sudo apt-get install --yes -qq build-essential autoconf libtool gawk alien fakeroot linux-headers-$(uname -r) libaio-dev
- sudo apt-get install --yes -qq zlib1g-dev uuid-dev libattr1-dev libblkid-dev libselinux-dev libudev-dev libssl-dev libjson-c-dev
- sudo apt-get install --yes -qq lcov libjemalloc-dev
# packages for tests
- sudo apt-get install --yes -qq parted lsscsi ksh attr acl nfs-kernel-server fio
- sudo apt-get install --yes -qq libgtest-dev cmake
# packages for debugging
- sudo apt-get install gdb
# use gcc-6 by default
- sudo unlink /usr/bin/gcc && sudo ln -s /usr/bin/gcc-6 /usr/bin/gcc
- sudo unlink /usr/bin/g++ && sudo ln -s /usr/bin/g++-6 /usr/bin/g++
install:
- pushd .
- cd /usr/src/gtest
- sudo cmake CMakeLists.txt
- sudo make -j4
- sudo cp *.a /usr/lib
- popd
# save the current location to get back
- pushd .
- cd ..
# we need fio repo to build zfs replica fio engine
- git clone https://github.com/axboe/fio
- cd fio
- git checkout fio-3.7
- ./configure
- make -j4
- cd ..
- git clone https://github.com/openebs/spl
- cd spl
- git checkout spl-0.7.9
- sh autogen.sh
- ./configure
- if [ $ZFS_BUILD_TAGS = 0 ]; then
make -j4;
else
make --no-print-directory -s pkg-utils pkg-kmod;
sudo dpkg -i *.deb;
fi
# return to cstor code
- popd
- sh autogen.sh
- if [ $ZFS_BUILD_TAGS = 0 ]; then
./configure --with-config=user --enable-code-coverage=yes --enable-debug --enable-uzfs=yes --with-jemalloc --with-fio=$PWD/../fio || travis_terminate 1;
make -j4;
else
./configure --enable-code-coverage=yes --enable-debug || travis_terminate 1;
make --no-print-directory -s pkg-utils pkg-kmod || travis_terminate 1;
sudo dpkg -i *.deb || travis_terminate 1;
fi
before_script:
- make cstyle;
script:
# run ztest and test supported zio backends
- if [ $ZFS_BUILD_TAGS = 0 ]; then
export FIO_SRCDIR=$PWD/../fio;
sudo bash ./print_debug_info.sh &
sudo bash ./tests/cbtest/script/test_uzfs.sh -T all || travis_terminate 1;
./build_image.sh || travis_terminate 1;
else
sudo /sbin/modprobe zfs;
travis_wait 10 /sbin/ztest || travis_terminate 1;
fi
after_failure:
- find /var/tmp/test_results/current/log -type f -name '*' -printf "%f\n" -exec cut -c -$ZFS_TEST_TRAVIS_LOG_MAX_LENGTH {} \;
after_success:
- find /var/tmp/test_results/current/log -type f -name '*' -printf "%f\n" -exec cut -c -$ZFS_TEST_TRAVIS_LOG_MAX_LENGTH {} \;
- bash <(curl -s https://codecov.io/bash)