Skip to content

Commit

Permalink
hexpm#44 add tarpaulin support
Browse files Browse the repository at this point in the history
  • Loading branch information
sitkevij committed Nov 8, 2020
1 parent d333b30 commit fe166b0
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: CI
on:
pull_request:
push:
branches:
- develop
- main
- master

env:
RUST_BACKTRACE: 1

jobs:
test:
name: Test Rust ${{ matrix.rust }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- { rust: stable, os: ubuntu-latest }
- { rust: stable, os: macos-latest }
- { rust: stable, os: windows-latest }
- { rust: stable-i686-msvc, os: windows-latest }
- { rust: beta, os: ubuntu-latest }
- { rust: nightly, os: ubuntu-latest }
steps:
- uses: actions/checkout@v2
- uses: hecrj/setup-rust-action@v1
with:
rust-version: ${{ matrix.rust }}
- run: cargo test --verbose --workspace
- run: cargo test --verbose --workspace --all-features
- run: cargo test --verbose --workspace --no-default-features

clippy:
name: Lint with clippy
runs-on: ubuntu-latest
env:
RUSTFLAGS: -Dwarnings
steps:
- uses: actions/checkout@v2
- uses: hecrj/setup-rust-action@v1
with:
components: clippy
- run: cargo clippy --workspace --all-targets --verbose
- run: cargo clippy --workspace --all-targets --verbose --no-default-features
- run: cargo clippy --workspace --all-targets --verbose --all-features

rustfmt:
name: Verify code formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: hecrj/setup-rust-action@v1
with:
components: rustfmt
- run: cargo fmt --all -- --check
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@
**/*.rs.bk

.DS_Store

# ci code coverage
tarpaulin-report.html
cobertura.xml
5 changes: 5 additions & 0 deletions .tarpaulin.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[default]
# Expected one of `Tests`, `Doctests`, `Benchmarks`, `Examples`, `Lib`, `Bins`, `AllTargets`
run-types = ["Tests"]
[report]
out = ["Html", "Xml"]
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ release: test
test:
cargo test --verbose --all -- --nocapture

tarpaulin:
# use docker as tarpaulin only supports x86_64 processors running linux
docker run --security-opt seccomp=unconfined -v "${PWD}:/volume" xd009642/tarpaulin
open tarpaulin-report.html

grcov:
# grcov requires rust nightly for now
rm -rf target/debug/
Expand Down

0 comments on commit fe166b0

Please sign in to comment.