Skip to content

Commit 5a32297

Browse files
authored
Simplify g++7 installation (#13)
Using Travis's built-in apt functionality rather than manual install.
1 parent 027f640 commit 5a32297

1 file changed

Lines changed: 19 additions & 25 deletions

File tree

.travis.yml

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,37 @@
11
language: cpp
2-
compiler: gcc
32
dist: xenial
43
notifications:
54
email: false
65

7-
addons:
8-
apt:
9-
packages: lcov
6+
matrix:
7+
include:
8+
- os: linux
9+
addons:
10+
apt:
11+
sources:
12+
- ubuntu-toolchain-r-test
13+
packages:
14+
- lcov
15+
- g++-7
16+
env:
17+
- CXX_COMPILER="g++-7"
1018

1119
before_install:
12-
# C++17
13-
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
14-
- sudo apt-get update -qq
15-
16-
install:
17-
# C++17
18-
- sudo apt-get install -qq g++-7
19-
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 90
20-
- sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-7 90
21-
22-
# Install coverals gem for uploading coverage to coveralls.
23-
- gem install coveralls-lcov
24-
25-
before_script:
26-
- lcov --version
27-
- gcov --version
28-
- g++ --version
2920
- PARENTDIR=$(pwd)
30-
- mkdir $PARENTDIR/build && cd $PARENTDIR/build
21+
- mkdir $PARENTDIR/build
3122

32-
script:
23+
install:
3324
- cd $PARENTDIR/build
34-
- cmake -DCMAKE_BUILD_TYPE=Coverage $PARENTDIR
25+
- cmake $PARENTDIR -DCMAKE_BUILD_TYPE=Coverage -DCMAKE_CXX_COMPILER=$CXX_COMPILER
3526
- make
27+
28+
script:
3629
- make coverage
3730

3831
after_success:
3932
- cd $PARENTDIR/build
4033
- lcov --list coverage_out.info.cleaned # Show test report in travis log.
34+
# Install coverals gem for uploading coverage to coveralls.
35+
- gem install coveralls-lcov
4136
- coveralls-lcov coverage_out.info.cleaned # uploads to coveralls
4237
- bash <(curl -s https://codecov.io/bash) -f coverage_out.info.cleaned || echo "Codecov did not collect coverage reports"
43-

0 commit comments

Comments
 (0)