Update README.md #34
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: coverage | |
on: | |
push: | |
branches: | |
- master | |
paths-ignore: | |
- 'coverage/**' | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build_coverage: | |
name: picori | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
toolchain: | |
- nightly | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: install | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
override: true | |
components: llvm-tools-preview | |
- name: grcov | |
run: curl -L https://github.com/mozilla/grcov/releases/latest/download/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar jxf - | |
- name: coverage | |
env: | |
RUSTFLAGS: '-Cinstrument-coverage' | |
LLVM_PROFILE_FILE: 'temp/coverage/coverage-%p-%m.profraw' | |
CARGO_INCREMENTAL: '0' | |
run: | | |
ls -lah | |
mkdir -p temp | |
cargo build --verbose | |
cargo test --verbose | |
./grcov . --binary-path ./target/debug/ -s . -t html --llvm --branch \ | |
--ignore-not-existing --ignore "/*" --ignore "examples/**" --ignore "scripts/**" \ | |
-o ./temp/coverage/ \ | |
--excl-start "grcov-excl-start" \ | |
--excl-stop "grcov-excl-stop" \ | |
--excl-line "grcov-excl-line|#\\[derive\\(|//!" \ | |
--excl-br-line "(#\\[derive\\()|(debug_assert)" | |
- name: upload coverage | |
env: | |
CI_COMMIT_AUTHOR: CI | |
CI_COMMIT_MESSAGE: CI Coverage Report | |
if: github.event_name == 'push' | |
run: | | |
git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}" | |
git config --global user.email "username@users.noreply.github.com" | |
git fetch | |
git checkout coverage -- | |
rm -rf coverage | |
cp -r temp/coverage/ coverage | |
git add coverage | |
git commit -m "${{ env.CI_COMMIT_MESSAGE }}" | |
git push |