-
Notifications
You must be signed in to change notification settings - Fork 52
42 lines (40 loc) · 1.55 KB
/
code-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
name: Code Coverage
on:
push:
branches:
- develop
- rc/*
paths-ignore:
- 'docs/**'
pull_request:
branches:
- develop
- rc/*
paths-ignore:
- 'docs/**'
jobs:
codecov:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'apache/tsfile' || github.event_name == 'push'
steps:
- uses: actions/checkout@v4
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2-
- name: Generate code coverage reports
run: |
sudo apt-get install lcov
./mvnw -B -P with-java,with-cpp,with-python,with-code-coverage clean verify
lcov --capture --directory cpp/target/build/test --output-file cpp/target/build/test/coverage.info
lcov --remove cpp/target/build/test/coverage.info '*/tsfile/cpp/test/*' --output-file cpp/target/build/test/coverage_filtered.info
genhtml cpp/target/build/test/coverage_filtered.info --output-directory cpp/target/build/test/coverage_report
rm -rf cpp/target/build/test/CMakeFiles/TsFile_Test.dir
rm -rf cpp/target/build/test/coverage.info
- name: Upload coverage reports to codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: java/tsfile/target/jacoco-merged-reports/jacoco.xml,cpp/target/build/test/coverage_report/index.html