Skip to content

Commit

Permalink
Merge pull request #1 from Diggsey/ci
Browse files Browse the repository at this point in the history
Implement coverage measurement
  • Loading branch information
Diggsey authored Nov 30, 2020
2 parents 89d6ba4 + 90e5989 commit 18450b4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
35 changes: 18 additions & 17 deletions .github/workflows/toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,29 +93,30 @@ jobs:
profile: minimal
toolchain: nightly
override: true
components: llvm-tools-preview
- uses: actions-rs/cargo@v1
with:
command: test
args: -- --test-threads=1
command: install
args: cargo-binutils rustfilt
- name: Build tests
run: |
cargo rustc --message-format=json --tests -- -Zinstrument-coverage | jq -r '.executable | strings' > executables.txt
- name: Run tests
run: |
while read p; do
exec "$p" --test-threads=1
done <executables.txt
env:
RUSTFLAGS: "-Zinstrument-coverage"
- name: Cache LLVM and Clang
id: cache-llvm
uses: actions/cache@v2
with:
path: ${{ runner.temp }}/llvm
key: llvm-11.0
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v1
with:
version: "11.0"
directory: ${{ runner.temp }}/llvm
cached: ${{ steps.cache-llvm.outputs.cache-hit }}
LLVM_PROFILE_FILE: "prof/%m.profraw"
- name: Generate coverage report
run: |
llvm-profdata merge -sparse default.profraw -o default.profdata
rust-profdata merge -sparse prof/*.profraw -o default.profdata
cat executables.txt | xargs -d '\n' rust-cov export -format='lcov' -instr-profile='default.profdata' > lcov.info
- name: Upload coverage report
uses: codecov/codecov-action@v1
with:
file: default.profdata
fail_ci_if_error: true
- uses: actions/upload-artifact@v2
with:
name: Upload coverage artifact
path: lcov.info
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[![CI Status](https://github.com/Diggsey/ijson/workflows/CI/badge.svg)](https://github.com/Diggsey/ijson/actions?query=workflow%3ACI)
[![Documentation](https://docs.rs/ijson/badge.svg)](https://docs.rs/ijson)
[![crates.io](https://img.shields.io/crates/v/ijson.svg)](https://crates.io/crates/ijson)
[![codecov](https://codecov.io/gh/Diggsey/ijson/branch/master/graph/badge.svg?token=XZ1UCUKSYB)](https://codecov.io/gh/Diggsey/ijson)

This crate offers a replacement for `serde-json`'s `Value` type, which is
significantly more memory efficient.
Expand Down

0 comments on commit 18450b4

Please sign in to comment.