drop circle, add clang-tidy to travis build (#389)

* drop circle, improve ci scripts
* allow branch builds
* travis: turn off sudo for one of the builds
This commit is contained in:
Valient Gough 2017-08-21 21:09:42 -07:00 committed by GitHub
parent 636766e620
commit 56978fb905
9 changed files with 81 additions and 82 deletions

View File

@ -1,35 +1,53 @@
language: cpp
sudo: true
matrix:
include:
- os: linux
compiler: gcc
dist: trusty
- os: osx
compiler: clang
osx_image: xcode8.3
branches:
only:
- master
- travis
before_script:
- ./ci/setup.sh
script:
- ./ci/build.sh
addons:
sudo: false
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- attr
- clang
- fuse
- libfuse-dev
- gettext
- cmake3
env:
- INTEGRATION=false
- os: linux
compiler: clang
dist: trusty
sudo: true
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-4.0
packages:
- attr
- fuse
- libfuse-dev
- gettext
- cmake3
- clang-4.0
- clang-tidy-4.0
env:
- CC=clang-4.0 CXX=clang++-4.0 CHECK=true INTEGRATION=true
- os: osx
compiler: clang
osx_image: xcode8.3
sudo: true
env:
- INTEGRATION=true
before_script:
- ./ci/setup.sh
script:
- ./build.sh

View File

@ -163,7 +163,7 @@ if (ENABLE_NLS)
endif (ENABLE_NLS)
if (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 3.5) # Need 3.6 or above.
find_program(CLANG_TIDY_EXE NAMES "clang-tidy" DOC "Path to clang-tidy executable")
find_program(CLANG_TIDY_EXE NAMES "clang-tidy" "clang-tidy-4.0" DOC "Path to clang-tidy executable")
if(NOT CLANG_TIDY_EXE)
message(STATUS "clang-tidy not found.")
else()
@ -171,6 +171,8 @@ if (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 3.5) # Need 3.6 or abo
set(DO_CLANG_TIDY "${CLANG_TIDY_EXE}" "-checks=*,-modernize-loop-convert,-cppcoreguidelines-pro-*,-readability-inconsistent-declaration-parameter-name,-google-readability-casting,-cert-err58-cpp,-google-runtime-int,-readability-named-parameter,-google-build-using-namespace,-misc-unused-parameters,-google-runtime-references")
#set(DO_CLANG_TIDY "${CLANG_TIDY_EXE}" "-fix" "-checks=-*,google-readability-redundant-smartptr-get")
endif()
else()
message(STATUS "clang-tidy check skipped, need newer cmake")
endif()
if (USE_INTERNAL_TINYXML)

View File

@ -1,7 +1,6 @@
# EncFS - an Encrypted Filesystem
_Build Status_
- Circle: [![Circle CI](https://circleci.com/gh/vgough/encfs.svg?style=svg)](https://circleci.com/gh/vgough/encfs)
- Travis: [![Travis CI](https://travis-ci.org/vgough/encfs.svg?branch=master)](https://travis-ci.org/vgough/encfs)
## About

View File

@ -1,20 +1,33 @@
#!/bin/bash -eu
# Make sure we are in the directory this script is in.
cd "$(dirname "$0")"
: ${CHECK:=false}
: ${INTEGRATION:=true}
cmake --version
CFG=$*
if [[ "$CHECK" == "true" ]]; then
CFG="-DLINT=ON $CFG"
fi
if uname -s | grep -q Darwin; then
CFG="-DENABLE_NLS=OFF -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl $CFG"
fi
if [[ ! -d build ]]
then
mkdir build
cd build
cmake .. $*
cd ..
fi
make -j2 -C build
make test -C build
make integration -C build
cd build
cmake .. ${CFG}
make -j2
make test
if [[ "$INTEGRATION" == "true" ]]; then
make integration
fi
cd ..
echo
echo 'Everything looks good, you can install via "make install -C build".'

View File

@ -1,22 +0,0 @@
#!/bin/bash -eu
cmake --version
CFG=""
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
CFG="-DENABLE_NLS=OFF -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl"
fi
if [[ ! -d build ]]
then
mkdir build
fi
cd build
cmake .. ${CFG}
make -j2
make test
make integration
cd ..

View File

@ -1,5 +0,0 @@
set -x
set -e
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX:PATH=/tmp/encfs -DCMAKE_BUILD_TYPE=Debug ..

View File

@ -1,5 +0,0 @@
set -x
set -e
sudo apt-get install -y gcc-4.8 g++-4.8
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 100
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 100

View File

@ -1,10 +1,23 @@
#!/bin/bash -eu
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
: ${INTEGRATION:=false}
: ${CHECK:=false}
if [[ "$INTEGRATION" == "true" ]]; then
if uname -s | grep -q Linux; then
sudo modprobe fuse
fi
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
elif uname -s | grep -q Darwin; then
brew cask install osxfuse
fi
fi
if [[ "$CHECK" == "true" ]]; then
if uname -s | grep -q Linux; then
wget https://cmake.org/files/v3.9/cmake-3.9.1-Linux-x86_64.tar.gz -O /tmp/cmake.tar.gz
tar -C /tmp/ -xf /tmp/cmake.tar.gz
sudo rm -f $(which cmake)
sudo ln -s $(ls -1 /tmp/cmake*/bin/cmake) /bin/
fi
fi

View File

@ -1,14 +0,0 @@
machine:
timezone:
America/Los_Angeles
dependencies:
pre:
- sudo apt-get install cmake libfuse-dev libgettextpo-dev
- bash ./ci/install-gcc.sh
test:
override:
- bash ./ci/config.sh
- cd build && make && make test && make install
- /tmp/encfs/bin/encfsctl --version