-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (53 loc) · 1.76 KB
/
codecov.yaml
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: CodeCov
on:
push:
pull_request:
types: [opened, synchronize, reopened]
permissions:
contents: read
jobs:
codecov:
name: Build
runs-on: ubuntu-latest
env:
BUILD_DIR: build_codecov
GCC_VERSION: 12
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: 'True'
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y "g++-$GCC_VERSION"
sudo apt-get install -y cmake lcov ninja-build
- name: Configure Build
run: |
mkdir "$BUILD_DIR"
cmake \
-G Ninja \
-S . \
-B "$BUILD_DIR" \
-D PEEJAY_COVERAGE=Yes \
-D CMAKE_C_COMPILER="gcc-$GCC_VERSION" \
-D CMAKE_CXX_COMPILER="g++-$GCC_VERSION"
- name: Build
run: |
cmake --build "$BUILD_DIR"
- name: Collect the Coverage
run: |
set -x
lcov \
--capture \
--output-file coverage.info \
--directory "$BUILD_DIR" \
--gcov-tool "gcov-$GCC_VERSION" \
--include "$(pwd)/*.?pp"
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@7f8b4b4bde536c465e797be725718b88c5d95e0e # v5.1.1
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}