Compare commits
1 commit
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1be19c1a34 |
4 changed files with 105 additions and 0 deletions
28
.travis.yml
Normal file
28
.travis.yml
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
language: c++
|
||||||
|
|
||||||
|
cache: ccache
|
||||||
|
|
||||||
|
git:
|
||||||
|
depth: 1
|
||||||
|
|
||||||
|
dist: xenial
|
||||||
|
|
||||||
|
sudo: true
|
||||||
|
|
||||||
|
install:
|
||||||
|
- sudo apt-get install --allow-unauthenticated libboost-thread-dev libboost-iostreams-dev libboost-date-time-dev libboost-system-dev libboost-filesystem-dev libboost-program-options-dev libboost-chrono-dev libboost-test-dev libboost-context-dev libboost-regex-dev libboost-coroutine-dev cmake parallel
|
||||||
|
|
||||||
|
addons:
|
||||||
|
|
||||||
|
env:
|
||||||
|
global:
|
||||||
|
- CCACHE_COMPRESS=exists_means_true
|
||||||
|
- CCACHE_MAXSIZE=1Gi
|
||||||
|
- CCACHE_SLOPPINESS=include_file_ctime,include_file_mtime,time_macros
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
include:
|
||||||
|
- stage: build for cache
|
||||||
|
script: ./programs/build_helpers/build_protocol
|
||||||
|
- stage: build and test
|
||||||
|
script: ./programs/build_helpers/build_and_test
|
||||||
11
programs/build_helpers/build_and_test
Normal file
11
programs/build_helpers/build_and_test
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
programs/build_helpers/buildstep -s 3500
|
||||||
|
ccache -s
|
||||||
|
programs/build_helpers/buildstep Prepare 1 "sed -i '/tests/d' libraries/fc/CMakeLists.txt"
|
||||||
|
programs/build_helpers/buildstep cmake 5 "cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS=--coverage -DCMAKE_CXX_FLAGS=--coverage -DBoost_USE_STATIC_LIBS=OFF -DCMAKE_CXX_OUTPUT_EXTENSION_REPLACE=ON ."
|
||||||
|
programs/build_helpers/buildstep make.fc 200 "make -j 2 fc"
|
||||||
|
programs/build_helpers/buildstep make.custom_auths 1000 "make -j 2 graphene_protocol"
|
||||||
|
programs/build_helpers/buildstep end 0
|
||||||
|
ccache -s
|
||||||
11
programs/build_helpers/build_protocol
Normal file
11
programs/build_helpers/build_protocol
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
programs/build_helpers/buildstep -s 3500
|
||||||
|
ccache -s
|
||||||
|
programs/build_helpers/buildstep Prepare 1 "sed -i '/tests/d' libraries/fc/CMakeLists.txt"
|
||||||
|
programs/build_helpers/buildstep cmake 5 "cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS=--coverage -DCMAKE_CXX_FLAGS=--coverage -DBoost_USE_STATIC_LIBS=OFF -DCMAKE_CXX_OUTPUT_EXTENSION_REPLACE=ON ."
|
||||||
|
programs/build_helpers/buildstep make.fc 200 "make -j 2 fc"
|
||||||
|
programs/build_helpers/buildstep make.custom_auths 1000 "make -j 2 graphene_protocol"
|
||||||
|
programs/build_helpers/buildstep end 0
|
||||||
|
ccache -s
|
||||||
55
programs/build_helpers/buildstep
Normal file
55
programs/build_helpers/buildstep
Normal file
|
|
@ -0,0 +1,55 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
usage () {
|
||||||
|
echo Usage:
|
||||||
|
echo " ${0##*/} [-h | --help] Display this help message"
|
||||||
|
echo " ${0##*/} -s | --start <max-time> Initialize timing"
|
||||||
|
echo " ${0##*/} <name> <est> <cmd>"
|
||||||
|
echo "The last form executes build step <name> consisting of shell <cmd>"
|
||||||
|
echo "if <est>imated time is still available, otherwise it fails fast."
|
||||||
|
echo "<max-time> and <est> must be specified in seconds."
|
||||||
|
exit $1
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ "$#" = 0 -o "$1" = "--help" -o "$1" = "-h" ]; then
|
||||||
|
usage `test "$#" = 1; echo $?`
|
||||||
|
fi
|
||||||
|
|
||||||
|
NOW="$(date +%s)"
|
||||||
|
|
||||||
|
if [ "$1" = "--start" -o "$1" = "-s" ]; then
|
||||||
|
if [ "$#" != 2 ]; then
|
||||||
|
usage 1
|
||||||
|
fi
|
||||||
|
echo "$2 $NOW" >_start_time
|
||||||
|
echo "Starting at $(date --date=@$NOW)"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
NAME="$1"
|
||||||
|
EST="$2"
|
||||||
|
CMD="$3"
|
||||||
|
|
||||||
|
if [ ! -r _start_time ]; then
|
||||||
|
echo "Need to initialize with '$0 -s <max-time>' first!" 1>&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
read max begin prev_name prev_begin <_start_time
|
||||||
|
|
||||||
|
if [ "$prev_name" != "" ]; then
|
||||||
|
echo "'$prev_name' took $(($NOW - $prev_begin))s"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$CMD" != "" ]; then
|
||||||
|
if [ $(($NOW - $begin + $EST)) -lt $max ]; then
|
||||||
|
echo "Running '$NAME' at $NOW..."
|
||||||
|
echo "sh -c '$CMD'"
|
||||||
|
echo "$max $begin $NAME $NOW" >_start_time
|
||||||
|
exec bash -c "$CMD"
|
||||||
|
fi
|
||||||
|
echo "$(($begin + $max - $NOW))s left - insufficient to run '$NAME', exiting!" 1>&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit 0
|
||||||
Loading…
Reference in a new issue