-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
63 lines (55 loc) · 1.9 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
language: cpp
cache:
directories:
- vcpkg
- build/vcpkg_installed
jobs:
include:
- os: linux
dist: focal
compiler: gcc
env:
- TRAVIS_BUILD_DOCS=1
- MATRIX_EVAL="CC=gcc-11 && CXX=g++-11"
- VCPKG_FEATURE_FLAGS=registries
addons: &gcc11
apt:
sources:
- sourceline: 'ppa:ubuntu-toolchain-r/test'
packages:
- gcc-11
- g++-11
- doxygen
- graphviz
- i2c-tools
- libi2c-dev
before_script:
- eval "${MATRIX_EVAL}"
script:
- mkdir -p build
- cd build
- cmake -DENABLE_COVERAGE:BOOL=TRUE -DENABLE_TESTING=ON -DENABLE_DOXYGEN=ON ../
- cmake --build . --target tests
- ctest
after_success:
# Generate the docs only if master, the travis_build_docs is true and we can use secure variables
- >-
if [[ "$TRAVIS_BRANCH" = "master" && -n "$TRAVIS_BUILD_DOCS" && "$TRAVIS_PULL_REQUEST" = "false" ]] ; then
cd $TRAVIS_BUILD_DIR
source .ci/setup-ssh.sh || travis_terminate 1
GH_REPO_ORG=`echo $TRAVIS_REPO_SLUG | cut -d "/" -f 1`
GH_REPO_NAME=`echo $TRAVIS_REPO_SLUG | cut -d "/" -f 2`
git clone -b gh-pages git@github.com:$GH_REPO_ORG/$GH_REPO_NAME.git code_docs
cd code_docs/
git config --global push.default simple
git config user.name "Travis CI"
git config user.email "travis@travis-ci.org"
git reset --hard `git rev-list --max-parents=0 --abbrev-commit HEAD`
echo 'Generating Doxygen code documentation...'
cmake --build ../build --target doxygen-docs
cp -r ../build/html/ .
echo 'Uploading documentation to the gh-pages branch...'
git add --all
git commit -m "Deploy code docs to GitHub Pages Travis build: ${TRAVIS_BUILD_NUMBER}" -m "Commit: ${TRAVIS_COMMIT}"
git push --force "git@github.com:$GH_REPO_ORG/$GH_REPO_NAME.git" > /dev/null 2>&1
fi