-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (56 loc) · 1.96 KB
/
build_and_test.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
64
65
name: Build and run tests
on:
push:
branches:
- master
pull_request:
branches-ignore:
- gh-pages
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
build_and_test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: "Install dependencies"
run: |
sudo apt-get update
sudo apt-get install -y \
clang-tidy-12 \
lcov \
ninja-build \
--install-suggests
sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-12 30
sudo update-alternatives --install /usr/bin/llvm-cov llvm-cov /usr/bin/llvm-cov-12 30
- name: "Add scripts to path"
working-directory: ${{ github.workspace }}
run: echo "$GITHUB_WORKSPACE/sh" >> $GITHUB_PATH
- name: "Configure build"
working-directory: ${{ github.workspace }}
run: |
cmake -S . -B build -G Ninja \
-D CMAKE_CXX_COMPILER=clang++-12 \
-D CMAKE_BUILD_TYPE=Debug \
-D TACHYON_OPTIONS_BUILD_TESTING=ON \
-D TACHYON_OPTIONS_ENABLE_PCH=OFF \
-D TACHYON_OPTIONS_ENABLE_COVERAGE=ON \
-D TACHYON_TOOLS_ENABLE_TIDY=ON \
-D TACHYON_TOOLS_ENABLE_FORMATTING=OFF \
-D TACHYON_TOOLS_ENABLE_TAGS=OFF
- name: "Build"
working-directory: ${{ github.workspace }}/build
run: cmake --build .
- name: "Run tests"
working-directory: ${{ github.workspace }}/build
run: ctest
- name: "Check coverage"
working-directory: ${{ github.workspace }}/build
run: |
echo "$GITHUB_WORKSPACE"
lcov --directory . --gcov-tool llvm_gcov.sh --capture --output-file coverage.info
lcov --remove coverage.info '/usr/*' "$GITHUB_WORKSPACE"'/extern/*' --output-file coverage.info
lcov --list coverage.info