-
Notifications
You must be signed in to change notification settings - Fork 314
61 lines (51 loc) · 2.12 KB
/
coverage.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
name: Coverage
on: [push, pull_request]
jobs:
build:
name: Code Coverage
runs-on: ubuntu-16.04
steps:
- name: Checkout source
uses: actions/checkout@v2
- name: Mount vcpkg cache
uses: actions/cache@v2
with:
path: "~/.cache/vcpkg/archives"
key: vcpkg-${{ matrix.os }}
- name: Install vcpkg dependencies
run: vcpkg install benchmark civetweb curl[core] gtest zlib
- name: Generate German locale on Ubuntu
if: runner.os == 'Linux'
run: |
sudo apt-get remove -y --purge man-db # avoid time-consuming trigger
sudo apt-get update
sudo apt-get install -y locales
sudo locale-gen de_DE.UTF-8 # used by SerializerTest
- name: Install ninja on Ubuntu
if: runner.os == 'Linux'
run: |
sudo apt-get install -y ninja-build
- name: Install coveralls
if: runner.os == 'Linux'
run: |
sudo apt-get install -y python-pip python-wheel
pip install --user cpp-coveralls
- name: "CMake Configure for Unix with vcpkg dependencies"
env:
CFLAGS: "--coverage"
CXXFLAGS: "--coverage"
LDFLAGS: "--coverage"
run: cmake -DUSE_THIRDPARTY_LIBRARIES=OFF "-DCMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" -GNinja -S ${{ github.workspace }} -B ${{ github.workspace }}/_build
- name: Build
run: cmake --build ${{ github.workspace }}/_build
- name: Test
run: ctest -V -LE Benchmark
working-directory: "${{ github.workspace }}/_build"
- name: Upload Coverage
if: github.repository == 'jupp0r/prometheus-cpp'
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
COVERALLS_GIT_BRANCH: "${{ github.ref }}"
TRAVIS_BRANCH: "${{ github.ref }}"
working-directory: "${{ github.workspace }}/_build"
run: ~/.local/bin/coveralls --root .. --build-root . --gcov-options '\-lp' -E ".*/3rdparty/.*" -E ".*/_.*" -E ".*/tests/.*" -E ".*/benchmarks/.*" -E "./CMake.*CompilerId.c" -E ".*/cmake/.*"