fix coverage (#582)
This commit is contained in:
parent
383ba03de0
commit
638c4b2ec9
|
@ -0,0 +1,38 @@
|
||||||
|
name: Upload CodeCov Report
|
||||||
|
|
||||||
|
on: [ push, pull_request ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout Code
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 2
|
||||||
|
|
||||||
|
- name: Install newer Clang
|
||||||
|
run: |
|
||||||
|
wget https://apt.llvm.org/llvm.sh
|
||||||
|
chmod +x ./llvm.sh
|
||||||
|
sudo ./llvm.sh 17
|
||||||
|
|
||||||
|
- name: Configure
|
||||||
|
run: |
|
||||||
|
cmake -B ${{github.workspace}}/build \
|
||||||
|
-DCMAKE_BUILD_TYPE=${{matrix.mode}} -DBUILD_WITH_LIBCXX=OFF -DENABLE_SSL=ON \
|
||||||
|
-DUSE_CCACHE=${{env.ccache}} -DCMAKE_C_COMPILER=clang-17 -DCMAKE_CXX_COMPILER=clang++-17
|
||||||
|
|
||||||
|
- name: Build with ${{ matrix.compiler }}
|
||||||
|
run: cmake --build ${{github.workspace}}/build --config Debug
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
working-directory: ${{github.workspace}}/build
|
||||||
|
env:
|
||||||
|
CTEST_OUTPUT_ON_FAILURE: 1
|
||||||
|
run: ctest -C ${{ matrix.configuration }} -j 1 -V
|
||||||
|
|
||||||
|
- name: Upload coverage to Codecov
|
||||||
|
uses: codecov/codecov-action@v1
|
|
@ -2,8 +2,9 @@ name: Ubuntu 22.04 (llvm cov)
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request_target:
|
pull_request_target:
|
||||||
branches: [ doc ]
|
branches:
|
||||||
workflow_dispatch:
|
- main
|
||||||
|
- fix_coverage
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
@ -17,7 +18,12 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get install openssl
|
sudo apt-get install openssl
|
||||||
sudo apt-get install libssl-dev
|
sudo apt-get install libssl-dev
|
||||||
sudo apt-get install llvm
|
|
||||||
|
- name: Install newer Clang
|
||||||
|
run: |
|
||||||
|
wget https://apt.llvm.org/llvm.sh
|
||||||
|
chmod +x ./llvm.sh
|
||||||
|
sudo ./llvm.sh 17
|
||||||
|
|
||||||
- name: Run Coverage
|
- name: Run Coverage
|
||||||
run: |
|
run: |
|
||||||
|
@ -25,12 +31,12 @@ jobs:
|
||||||
cp -r src/coro_rpc/tests/openssl_files .
|
cp -r src/coro_rpc/tests/openssl_files .
|
||||||
ls
|
ls
|
||||||
mkdir build && cd build
|
mkdir build && cd build
|
||||||
CC=clang CXX=clang++ cmake .. -DCOVERAGE_TEST=ON -DENABLE_SSL=ON
|
CC=clang-17 CXX=clang++-17 cmake .. -DCOVERAGE_TEST=ON -DENABLE_SSL=ON
|
||||||
make -j test_rpc
|
make -j test_rpc
|
||||||
export LLVM_PROFILE_FILE="test_rpc-%m.profraw"
|
export LLVM_PROFILE_FILE="test_rpc-%m.profraw"
|
||||||
./tests/test_rpc
|
./tests/test_rpc
|
||||||
llvm-profdata merge -sparse test_rpc-*.profraw -o test_rpc.profdata
|
llvm-profdata merge -sparse test_rpc-*.profraw -o test_rpc.profdata
|
||||||
llvm-cov show ./tests/test_rpc -instr-profile=test_rpc.profdata -format=html -output-dir=../.coverage_llvm_cov -ignore-filename-regex="async_simple|thirdparty|tests|asio|util|logging|struct_pack" -show-instantiations=false
|
llvm-cov show ./tests/test_rpc -instr-profile=test_rpc.profdata -format=html -output-dir=../.coverage_llvm_cov -ignore-filename-regex="thirdparty|asio" -show-instantiations=false
|
||||||
echo "Done!"
|
echo "Done!"
|
||||||
|
|
||||||
- name: Upload Coverage Results
|
- name: Upload Coverage Results
|
||||||
|
@ -45,7 +51,7 @@ jobs:
|
||||||
echo "Code Coverage Report" > tmp.log
|
echo "Code Coverage Report" > tmp.log
|
||||||
echo "for detail, [goto summary](https://github.com/${{ github.repository_owner }}/${{ github.event.repository.name }}/actions/runs/${{github.run_id}}) download Artifacts `llvm-cov`" >> tmp.log
|
echo "for detail, [goto summary](https://github.com/${{ github.repository_owner }}/${{ github.event.repository.name }}/actions/runs/${{github.run_id}}) download Artifacts `llvm-cov`" >> tmp.log
|
||||||
echo "\`\`\`" >> tmp.log
|
echo "\`\`\`" >> tmp.log
|
||||||
llvm-cov report ./tests/test_rpc -instr-profile=test_rpc.profdata -ignore-filename-regex="thirdparty|tests" -show-region-summary=false >> tmp.log
|
llvm-cov report ./tests/test_rpc -instr-profile=test_rpc.profdata -ignore-filename-regex="thirdparty|asio" -show-region-summary=false >> tmp.log
|
||||||
echo "\`\`\`" >> tmp.log
|
echo "\`\`\`" >> tmp.log
|
||||||
|
|
||||||
- name: Create Comment
|
- name: Create Comment
|
||||||
|
|
Loading…
Reference in New Issue