2017-11-15 22:00:13 +00:00
|
|
|
# Setup environment for Docker
|
|
|
|
language: generic
|
|
|
|
services: docker
|
2013-01-10 07:16:20 +00:00
|
|
|
notifications:
|
2018-05-27 21:39:42 +00:00
|
|
|
email: false
|
2014-11-18 16:43:38 +00:00
|
|
|
|
2018-05-27 21:39:42 +00:00
|
|
|
# Environment setup before test script. Runs for each build
|
2017-11-15 22:00:13 +00:00
|
|
|
before_install:
|
2018-05-27 21:39:42 +00:00
|
|
|
# Check if anything has changed within the docker directory
|
2018-06-04 21:08:22 +00:00
|
|
|
- DOCKER_CHANGED=`git diff --name-only $TRAVIS_COMMIT_RANGE -- tools/docker | wc -l`
|
2018-05-27 21:39:42 +00:00
|
|
|
# If Docker directory has not changed, pull image from Dockerhub. Else, build
|
|
|
|
# image from Dockerifle. This needs to be done for each job. Any build error
|
|
|
|
# will count as Travis test failure. In case this updates develop, push new
|
|
|
|
# image to Dockerhub (secure credentials only readable on bulids to
|
|
|
|
# contiki-ng/contiki-ng branches, not forks or PRs)
|
|
|
|
- >
|
|
|
|
if [ $DOCKER_CHANGED == 0 ]; then
|
|
|
|
echo "Docker image unchanged, pull from Dockerhub"
|
|
|
|
docker pull $DOCKER_IMG;
|
|
|
|
else
|
|
|
|
echo "Docker image changed, build from Dockerfile"
|
|
|
|
docker build tools/docker -t $DOCKER_IMG;
|
2018-06-05 13:11:32 +00:00
|
|
|
if [ $? != 0 ]; then
|
|
|
|
echo "Failed to build Docker image"
|
|
|
|
exit 1
|
|
|
|
fi
|
2018-05-27 21:39:42 +00:00
|
|
|
if [ $TRAVIS_SECURE_ENV_VARS == true ] && [ $TRAVIS_PULL_REQUEST == false ] && [ $TRAVIS_BRANCH == 'develop' ]; then
|
|
|
|
echo "This build is for an update of branch develop. Push image to Dockerhub"
|
|
|
|
echo $DOCKERHUB_PASSWD | docker login --username contiker --password-stdin
|
|
|
|
docker push $DOCKER_IMG;
|
|
|
|
fi
|
|
|
|
fi
|
2018-10-21 18:36:35 +00:00
|
|
|
# Build Cooja conditionally
|
|
|
|
- if [ ${BUILD_COOJA:-false} = true ] ; then
|
|
|
|
ant -q -f $CNG_HOST_PATH/tools/cooja/build.xml jar ;
|
|
|
|
fi
|
2018-05-27 21:39:42 +00:00
|
|
|
# Set permissions for Docker mount
|
|
|
|
- sudo chgrp -hR 1000 $CNG_HOST_PATH
|
2017-11-15 22:00:13 +00:00
|
|
|
|
2018-05-27 21:39:42 +00:00
|
|
|
# The test script for each build
|
|
|
|
script:
|
2018-03-02 15:45:05 +00:00
|
|
|
- docker run --privileged -v $CNG_HOST_PATH:/home/user/contiki-ng -ti $DOCKER_IMG bash --login -c "make -C tests/??-$TEST_NAME";
|
2017-11-15 22:00:13 +00:00
|
|
|
# Check outcome of the test
|
|
|
|
- $CNG_HOST_PATH/tests/check-test.sh $CNG_HOST_PATH/tests/??-$TEST_NAME; exit $?;
|
2012-11-12 22:26:17 +00:00
|
|
|
|
2018-05-27 21:39:42 +00:00
|
|
|
# Environment variables
|
2012-11-12 22:26:17 +00:00
|
|
|
env:
|
2018-05-27 21:39:42 +00:00
|
|
|
# Global environment variables, i.e., set for all builds
|
|
|
|
global:
|
|
|
|
- DOCKER_IMG='contiker/contiki-ng'
|
|
|
|
- CNG_HOST_PATH=`pwd`
|
|
|
|
# Encrypted environment variables.
|
|
|
|
# Only available on builds of contiki-ng/contiki-ng branches, not PRs or forks.
|
|
|
|
- secure: 0nrV5yjpT2kE19Hlm7t619Qbmyjx/G7bSUI1c+U3kZbyuxnRlASjVcDN5uPBoimIfGiBRI0nRq690BogAJt4EKwbC1Dy8kC1XD8mRtQ2AIZ6PHaUoG9iS5sBhFBQK0XkB83bwh6omRn/04O0uuX74ooSWT7fDrWxi/y5+0ysXK6gRtOhdrJ3FU5OkNVewX8NeCdx3pOWhMOtXWdFkMIi1XRdDnvMM5/hHlHMkdXXtaZQX9UsK3Q3DSjPRLZjKRiOlcx9MIg2ebh9ITmd2Du2p2q/LKtoutJckvhbKQPWcZi/B+1ZTSff0FHBIg+EYxf6TeFuia7XSTWH7sr2CDCCtcvSR9bB5yW6jdmGfa8Af8I1TCBuqoSUo0Re50BZBZF7COleEh+IojbjXn2CIDMg5rT4Sh3qcMGvFn9OW1cz5h5UNSOk7EIAXXPcI7Aloxh2sBo4/DrvvbfIsKrvxV9Fx4bdyNtR7dZ7xsoOw6L0zttC3K9naf3VAOeBAyjBiRwm0tWxJC/buhTsKlYrthhyUrwLtYAFL4UHcazvz57hY/cEzR2X6F//9Hp7HFoNtn1E36doX3ZfeI22yxHMo9SYW7O69C45wbhJ29lAA9XXbYVyGBKFkY8C1NCZ0Xckt9H8/Ow5Sz8HmW/NNBJCn0Fsx+jezdGc4ED5naugNbLAyNg=
|
|
|
|
# Each line in the 'matrix' triggers a separate Travis build
|
|
|
|
matrix:
|
|
|
|
- TEST_NAME='compile-base'
|
|
|
|
- TEST_NAME='compile-arm-ports-01'
|
|
|
|
- TEST_NAME='compile-arm-ports-02'
|
2018-10-21 18:36:35 +00:00
|
|
|
- TEST_NAME='rpl-lite' BUILD_COOJA=true
|
|
|
|
- TEST_NAME='rpl-classic' BUILD_COOJA=true
|
|
|
|
- TEST_NAME='tun-rpl-br' BUILD_COOJA=true
|
2018-05-27 21:39:42 +00:00
|
|
|
- TEST_NAME='coap-lwm2m'
|
2018-10-21 18:36:35 +00:00
|
|
|
- TEST_NAME='simulation-base' BUILD_COOJA=true
|
|
|
|
- TEST_NAME='ieee802154' BUILD_COOJA=true
|
2018-05-27 21:39:42 +00:00
|
|
|
- TEST_NAME='compile-nxp-ports'
|
2018-06-05 11:11:29 +00:00
|
|
|
- TEST_NAME='documentation'
|
2018-05-27 21:39:42 +00:00
|
|
|
- TEST_NAME='compile-tools'
|
|
|
|
- TEST_NAME='native-runs'
|
2018-10-21 18:36:35 +00:00
|
|
|
- TEST_NAME='ipv6' BUILD_COOJA=true
|