Skip to content

Commit b49820b

Browse files
author
Daniel Kroening
authored
Merge pull request #1264 from tautschnig/ci-workarounds
[tgs->master] continuous integration fixes and workarounds
2 parents 1d2cfb5 + 988468f commit b49820b

File tree

4 files changed

+69
-52
lines changed

4 files changed

+69
-52
lines changed

.travis.yml

Lines changed: 55 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,61 @@
11
language: cpp
22

3-
matrix:
3+
jobs:
44
include:
55

6+
- &linter-stage
7+
stage: Linter + Doxygen + non-debug Ubuntu/gcc-5 test
8+
env: NAME="CPP-LINT"
9+
install:
10+
script: scripts/travis_lint.sh
11+
before_cache:
12+
13+
- stage: Linter + Doxygen + non-debug Ubuntu/gcc-5 test
14+
env: NAME="DOXYGEN-CHECK"
15+
addons:
16+
apt:
17+
packages:
18+
- doxygen
19+
install:
20+
script: scripts/travis_doxygen.sh
21+
before_cache:
22+
23+
# Ubuntu Linux with glibc using g++-5
24+
- stage: Linter + Doxygen + non-debug Ubuntu/gcc-5 test
25+
os: linux
26+
sudo: false
27+
compiler: gcc
28+
cache: ccache
29+
addons:
30+
apt:
31+
sources:
32+
- ubuntu-toolchain-r-test
33+
packages:
34+
- libwww-perl
35+
- g++-5
36+
- libubsan0
37+
before_install:
38+
- mkdir bin ; ln -s /usr/bin/gcc-5 bin/gcc
39+
# env: COMPILER=g++-5 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover -fno-omit-frame-pointer"
40+
env: COMPILER="ccache g++-5"
41+
642
# Alpine Linux with musl-libc using g++
7-
- os: linux
43+
- stage: Test different OS/CXX/Flags
44+
os: linux
845
sudo: required
946
compiler: gcc
1047
cache: ccache
1148
services:
1249
- docker
1350
before_install:
14-
- docker pull diffblue/cbmc-builder:alpine-0.0.1
51+
- docker pull diffblue/cbmc-builder:alpine-0.0.3
1552
env:
16-
- PRE_COMMAND="docker run -v ${TRAVIS_BUILD_DIR}:/cbmc -v ${HOME}/.ccache:/root/.ccache diffblue/cbmc-builder:alpine-0.0.1"
53+
- PRE_COMMAND="docker run -v ${TRAVIS_BUILD_DIR}:/cbmc -v ${HOME}/.ccache:/root/.ccache diffblue/cbmc-builder:alpine-0.0.3"
1754
- COMPILER="ccache g++"
1855

1956
# OS X using g++
20-
- os: osx
57+
- stage: Test different OS/CXX/Flags
58+
os: osx
2159
sudo: false
2260
compiler: gcc
2361
cache: ccache
@@ -26,42 +64,24 @@ matrix:
2664
- mkdir bin ; ln -s /usr/bin/gcc bin/gcc
2765
- HOMEBREW_NO_AUTO_UPDATE=1 brew install ccache
2866
- export PATH=/usr/local/opt/ccache/libexec:$PATH
29-
- ccache -M 1G
30-
env: COMPILER=g++
67+
env: COMPILER="ccache g++"
3168

3269
# OS X using clang++
33-
- os: osx
70+
- stage: Test different OS/CXX/Flags
71+
os: osx
3472
sudo: false
3573
compiler: clang
3674
cache: ccache
3775
before_install:
3876
- HOMEBREW_NO_AUTO_UPDATE=1 brew install ccache
3977
- export PATH=/usr/local/opt/ccache/libexec:$PATH
40-
- ccache -M 1G
4178
env:
4279
- COMPILER="ccache clang++ -Qunused-arguments -fcolor-diagnostics"
4380
- CCACHE_CPP2=yes
4481

45-
# Ubuntu Linux with glibc using g++-5
46-
- os: linux
47-
sudo: false
48-
compiler: gcc
49-
cache: ccache
50-
addons:
51-
apt:
52-
sources:
53-
- ubuntu-toolchain-r-test
54-
packages:
55-
- libwww-perl
56-
- g++-5
57-
- libubsan0
58-
before_install:
59-
- mkdir bin ; ln -s /usr/bin/gcc-5 bin/gcc
60-
# env: COMPILER=g++-5 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover -fno-omit-frame-pointer"
61-
env: COMPILER="g++-5"
62-
6382
# Ubuntu Linux with glibc using g++-5, debug mode
64-
- os: linux
83+
- stage: Test different OS/CXX/Flags
84+
os: linux
6585
sudo: false
6686
compiler: gcc
6787
cache: ccache
@@ -77,12 +97,13 @@ matrix:
7797
- mkdir bin ; ln -s /usr/bin/gcc-5 bin/gcc
7898
# env: COMPILER=g++-5 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover -fno-omit-frame-pointer"
7999
env:
80-
- COMPILER="g++-5"
100+
- COMPILER="ccache g++-5"
81101
- EXTRA_CXXFLAGS="-DDEBUG"
82102
script: echo "Not running any tests for a debug build."
83103

84104
# Ubuntu Linux with glibc using clang++-3.7
85-
- os: linux
105+
- stage: Test different OS/CXX/Flags
106+
os: linux
86107
sudo: false
87108
compiler: clang
88109
cache: ccache
@@ -105,7 +126,8 @@ matrix:
105126
- CCACHE_CPP2=yes
106127

107128
# Ubuntu Linux with glibc using clang++-3.7, debug mode
108-
- os: linux
129+
- stage: Test different OS/CXX/Flags
130+
os: linux
109131
sudo: false
110132
compiler: clang
111133
cache: ccache
@@ -129,27 +151,11 @@ matrix:
129151
- EXTRA_CXXFLAGS="-DDEBUG"
130152
script: echo "Not running any tests for a debug build."
131153

132-
- env: NAME="CPP-LINT"
133-
install:
134-
script: scripts/travis_lint.sh
135-
before_cache:
136-
137-
- env: NAME="DOXYGEN-CHECK"
138-
addons:
139-
apt:
140-
packages:
141-
- doxygen
142-
install:
143-
script: scripts/travis_doxygen.sh
144-
before_cache:
145-
146154
allow_failures:
147-
- env: NAME="CPP-LINT"
148-
install:
149-
script: scripts/travis_lint.sh
150-
before_cache:
155+
- <<: *linter-stage
151156

152157
install:
158+
- ccache --max-size=1G
153159
- COMMAND="make -C src minisat2-download" &&
154160
eval ${PRE_COMMAND} ${COMMAND}
155161
- COMMAND="make -C src CXX=\"$COMPILER\" CXXFLAGS=\"-Wall -Werror -pedantic -O2 -g $EXTRA_CXXFLAGS\" -j2" &&

scripts/run_diff.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,17 @@ then
3838
doxygen=doxygen
3939
doxygenlogdir="doc/html"
4040
doxygenlog="$doxygenlogdir/doxygen.log"
41+
suppress_warnings=(
42+
"warning: Included by graph for .* not generated, too many nodes. Consider increasing DOT_GRAPH_MAX_NODES.")
4143
if ! $doxygen --version &>/dev/null
4244
then
4345
echo "Lint script could not be found in the $script_folder directory"
4446
echo "Ensure cpplint.py is inside the $script_folder directory then run again"
4547
exit 1
4648
else
4749
mkdir -p $doxygenlogdir && cd src && $doxygen &> ../$doxygenlog && cd ..
48-
cmd='cat $doxygenlog'
50+
suppress_warnings_regex=$(IFS="|" ; echo "${suppress_warnings[*]}")
51+
cmd='grep -Ev "$suppress_warnings_regex" $doxygenlog'
4952
fi
5053
else
5154
echo "Mode $mode not recognized"

scripts/travis_doxygen.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,9 @@ pip install --user unidiff
88
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
99
$script_folder/run_diff.sh DOXYGEN HEAD~1 # Check for errors introduced in last commit
1010
else
11-
$script_folder/run_diff.sh DOXYGEN $TRAVIS_BRANCH # Check for errors compared to merge target
11+
TMP_HEAD=$(git rev-parse HEAD)
12+
git config remote.origin.fetch +refs/heads/$TRAVIS_BRANCH:refs/remotes/origin/$TRAVIS_BRANCH
13+
git fetch --unshallow
14+
git checkout $TMP_HEAD
15+
$script_folder/run_diff.sh DOXYGEN origin/$TRAVIS_BRANCH # Check for errors compared to merge target
1216
fi

scripts/travis_lint.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,9 @@ pip install --user unidiff
88
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
99
$script_folder/run_diff.sh CPPLINT HEAD~1 # Check for errors introduced in last commit
1010
else
11-
$script_folder/run_diff.sh CPPLINT $TRAVIS_BRANCH # Check for errors compared to merge target
11+
TMP_HEAD=$(git rev-parse HEAD)
12+
git config remote.origin.fetch +refs/heads/$TRAVIS_BRANCH:refs/remotes/origin/$TRAVIS_BRANCH
13+
git fetch --unshallow
14+
git checkout $TMP_HEAD
15+
$script_folder/run_diff.sh CPPLINT origin/$TRAVIS_BRANCH # Check for errors compared to merge target
1216
fi

0 commit comments

Comments
 (0)