From 1aea10010bbb7f7a584a57d63846ca7239ed2123 Mon Sep 17 00:00:00 2001 From: Patrick Niklaus Date: Fri, 28 Apr 2017 14:43:00 +0000 Subject: [PATCH] Run the docs in CI again --- .travis.yml | 15 +++++++++++---- scripts/error_on_dirty.sh | 16 ++++++++++++++++ scripts/format.sh | 11 ----------- 3 files changed, 27 insertions(+), 15 deletions(-) create mode 100755 scripts/error_on_dirty.sh diff --git a/.travis.yml b/.travis.yml index 2cd491c56..43af0ba42 100644 --- a/.travis.yml +++ b/.travis.yml @@ -48,13 +48,22 @@ matrix: # Debug Builds - os: linux - compiler: "format-taginfo" + compiler: "format-taginfo-docs" + env: NODE=6 sudo: false before_install: install: + - source $NVM_DIR/nvm.sh + - nvm install $NODE + - nvm use $NODE + - npm --version + - npm install --ignore-scripts + - npm link --ignore-scripts script: - - ${MASON} install clang-format 3.8.1 && PATH=$(${MASON} prefix clang-format 3.8.1)/bin:${PATH} ./scripts/format.sh + - ${MASON} install clang-format 3.8.1 + - PATH=$(${MASON} prefix clang-format 3.8.1)/bin:${PATH} ./scripts/format.sh && ./scripts/error_on_dirty.sh - ./scripts/check_taginfo.py taginfo.json profiles/car.lua + - npm run docs && ./scripts/error_on_dirty.sh after_success: - os: linux @@ -332,8 +341,6 @@ install: - cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} - make --jobs=${JOBS} - popd - # building docs only works with npm3+ not with yarn or npm2 - #- yarn run docs script: - if [[ $TARGET_ARCH == armhf ]] ; then echo "Skip tests for $TARGET_ARCH" && exit 0 ; fi diff --git a/scripts/error_on_dirty.sh b/scripts/error_on_dirty.sh new file mode 100755 index 000000000..f0328646d --- /dev/null +++ b/scripts/error_on_dirty.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +set -o errexit +set -o pipefail +set -o nounset + +MSG="The following files have been modified:" +dirty=$(git ls-files --modified) + +if [[ $dirty ]]; then + echo $MSG + echo $dirty + exit 1 +else + exit 0 +fi diff --git a/scripts/format.sh b/scripts/format.sh index eaeca05ad..6b14688dc 100755 --- a/scripts/format.sh +++ b/scripts/format.sh @@ -36,14 +36,3 @@ fi find src include unit_tests example -type f -name '*.hpp' -o -name '*.cpp' \ | xargs -I{} -P ${NPROC} ${CLANG_FORMAT} -i -style=file {} - - -dirty=$(git ls-files --modified) - -if [[ $dirty ]]; then - echo "The following files do not adhere to the .clang-format style file:" - echo $dirty - exit 1 -else - exit 0 -fi