forked from include-what-you-use/include-what-you-use
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.travis.yml
40 lines (32 loc) · 1.01 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
dist: bionic
language: cpp
addons:
apt:
sources:
- sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-11 main'
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
packages:
- cmake
- ninja-build
- llvm-11-dev
- libclang-11-dev
- clang-11
before_install:
# Extract the version number from the most-recently installed LLVM
- VERSION=`ls -t /usr/lib/ | grep '^llvm-' | head -n 1 | sed -E 's/llvm-(.+)/\1/'`
# Absolute paths to LLVM's root and bin directory
- PREFIX_PATH=`llvm-config-$VERSION --prefix`
- BIN_PATH=`llvm-config-$VERSION --bindir`
script:
# Build IWYU
- mkdir build
- cd build
- cmake -GNinja -DCMAKE_PREFIX_PATH=$PREFIX_PATH -DCMAKE_C_COMPILER=$BIN_PATH/clang -DCMAKE_CXX_COMPILER=$BIN_PATH/clang++ -DCMAKE_INSTALL_PREFIX=./ ../
- ninja
# Test IWYU
- CTEST_OUTPUT_ON_FAILURE=1 ninja test
# Test install
- ninja install
# Check license headers
- cd ../
- git ls-tree --full-tree --name-only -r HEAD | xargs ./iwyu-check-license-header.py