Skip to content

Commit

Permalink
add llvm cov ci (qicosmos#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
PikachuHyA authored Nov 2, 2022
1 parent a79e206 commit b373044
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
43 changes: 43 additions & 0 deletions .github/workflows/linux_llvm_cov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Ubuntu 22.04 (llvm cov)

on:
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-22.04

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Dependencies
run: |
sudo apt-get install openssl
sudo apt-get install libssl-dev
sudo apt-get install llvm
- name: Run Coverage Script
run: bash coverage_gen.sh llvm

- name: Upload Coverage Results
uses: actions/upload-artifact@v3
with:
name: llvm-cov
path: ${{ github.workspace }}/.coverage_llvm_cov

- name: Create Code Coverage Report
working-directory: ${{github.workspace}}/build
run: |
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 "\`\`\`" >> tmp.log
llvm-cov report ./tests/test_rpc -instr-profile=test_rpc.profdata -ignore-filename-regex="thirdparty|tests" -show-region-summary=false >> tmp.log
echo "\`\`\`" >> tmp.log
- name: Create Comment
uses: peter-evans/create-or-update-comment@v2
with:
issue-number: ${{ github.event.pull_request.number }}
body-file: '${{github.workspace}}/build/tmp.log'
2 changes: 1 addition & 1 deletion coverage_gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ export LLVM_PROFILE_FILE="test_rpc-%m.profraw"
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
echo 'Done!!!'
fi
fi

0 comments on commit b373044

Please sign in to comment.