forked from OpenAMP/open-amp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
88 lines (78 loc) · 3.23 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
language: minimal # setting language to C will override cross-compiler and fail
compiler:
- gcc
sudo: required
dist: trusty
env:
global:
- ZEPHYR_TOOLCHAIN_VARIANT=zephyr
- ZEPHYR_SDK_INSTALL_DIR=/opt/zephyr-sdk
- ZEPHYR_BASE=$TRAVIS_BUILD_DIR/deps/zephyr
- ZEPHYR_SDK_VERSION=0.9.3
- ZEPHYR_SDK_DOWNLOAD_FOLDER=https://github.com/zephyrproject-rtos/meta-zephyr-sdk/releases/download/$ZEPHYR_SDK_VERSION
- ZEPHYR_SDK_SETUP_BINARY=zephyr-sdk-$ZEPHYR_SDK_VERSION-setup.run
- ZEPHYR_SDK_DOWNLOAD_URL=$ZEPHYR_SDK_DOWNLOAD_FOLDER/$ZEPHYR_SDK_SETUP_BINARY
matrix:
fast_finish: true
include:
- os: linux
env: TARGET="linux"
# - os: linux
# env: TARGET="zephyr"
cache:
directories:
- $ZEPHYR_SDK_INSTALL_DIR
- /usr/local/bin
before_install:
- if [[ "$TARGET" == "linux" ]]; then
sudo apt-get update -qq &&
sudo apt-get install libsysfs-dev libhugetlbfs-dev make gcc &&
sudo pip install pytest pexpect;
fi
- if [[ "$TARGET" == "zephyr" ]]; then
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test &&
sudo apt-get update -qq &&
sudo apt-get install libc6-dev-i386 make gperf gcc g++ python3-ply python3-yaml python3-pip device-tree-compiler ncurses-dev uglifyjs -qq &&
sudo pip3 install pyelftools;
fi
install: >
if [[ "$TARGET" == "zephyr" && "$(cat $ZEPHYR_SDK_INSTALL_DIR/sdk_version)" != "$ZEPHYR_SDK_VERSION" ]]; then
wget $ZEPHYR_SDK_DOWNLOAD_URL &&
chmod +x $ZEPHYR_SDK_SETUP_BINARY &&
rm -rf $ZEPHYR_SDK_INSTALL_DIR &&
./$ZEPHYR_SDK_SETUP_BINARY --quiet -- -y -d $ZEPHYR_SDK_INSTALL_DIR > /dev/null;
fi
before_script: >
if [[ "$TARGET" == "linux" ]]; then
cd $TRAVIS_BUILD_DIR/.. &&
git clone --depth=1 git://github.com/OpenAMP/openamp-test-scripts.git &&
git clone --depth=1 git://github.com/OpenAMP/libmetal.git;
fi;
if [[ "$TARGET" == "zephyr" ]]; then
git clone --depth=1 git://github.com/zephyrproject-rtos/zephyr.git &&
cd zephyr &&
source zephyr-env.sh;
fi
script:
- if [[ "$TARGET" == "linux" ]]; then
cd $TRAVIS_BUILD_DIR &&
mkdir -p build-linux &&
mkdir -p ../libmetal/build-linux &&
cd ../libmetal/build-linux &&
cmake .. &&
make VERBOSE=1 DESTDIR=$(pwd) install &&
cd ../../open-amp/build-linux &&
cmake .. -DCMAKE_LIBRARY_PATH=${TRAVIS_BUILD_DIR}/../libmetal/build-linux/usr/local/lib -DCMAKE_INCLUDE_PATH=${TRAVIS_BUILD_DIR}/../libmetal/build-linux/usr/local/include -DWITH_APPS=on &&
make VERBOSE=1 DESTDIR=$(pwd) install &&
LD_LIBRARY_PATH=../../libmetal/build-linux/usr/local/lib:usr/local/lib PATH=usr/local/bin:${PATH} PROMPT="travis@.*:" python -m pytest -s ../../openamp-test-scripts/test-rpmsg.py;
fi
- if [[ "$TARGET" == "zephyr" ]]; then
mkdir -p ../open-amp/build-zephyr &&
mkdir -p ../libmetal/build-zephyr &&
cd ../libmetal/build-zephyr &&
cmake .. -DWITH_ZEPHYR=on -DBOARD=qemu_cortex_m3 &&
make &&
cd ../../open-amp/build-zephyr &&
cmake .. -DWITH_ZEPHYR=ON -DWITH_PROXY=OFF -DBOARD=qemu_cortex_m3 -DLIBMETAL_INCLUDE_DIR=../../libmetal/build-zephyr/lib/include -DLIBMETAL_LIB=../../libmetal/build-zephyr/lib/libmetal.a &&
make VERBOSE=1;
fi