forked from include-what-you-use/include-what-you-use
-
Notifications
You must be signed in to change notification settings - Fork 4
63 lines (53 loc) · 1.59 KB
/
ci.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
name: IWYU CI
on:
- push
- pull_request
defaults:
run:
shell: bash
jobs:
build:
runs-on: ubuntu-18.04
strategy:
fail-fast: false
env:
LLVM_TAG:
steps:
- name: Install prerequisites
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic$LLVM_TAG main"
sudo apt update
sudo apt install -y ninja-build
# Remove any base dist LLVM/Clang installations
sudo apt remove -y "libclang-dev*"
sudo apt remove -y "clang*"
sudo apt remove -y "llvm*"
# Reinstall tagged versions
sudo apt install -y llvm$LLVM_TAG-dev
sudo apt install -y libclang$LLVM_TAG-dev
sudo apt install -y clang$LLVM_TAG
- name: Check out default branch
uses: actions/checkout@v2
- name: Build include-what-you-use
run: |
mkdir build
cd ./build
cmake -G Ninja \
-DCMAKE_C_COMPILER=clang$LLVM_TAG \
-DCMAKE_CXX_COMPILER=clang++$LLVM_TAG \
-DCMAKE_INSTALL_PREFIX=./ \
../
ninja
- name: Test include-what-you-use
run: |
cd ./build
CTEST_OUTPUT_ON_FAILURE=1 ctest -j 6
- name: Test install
run: |
cd ./build
cmake --install .
- name: Check license headers
run: |
git ls-tree --full-tree --name-only -r HEAD | \
xargs ./iwyu-check-license-header.py