summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsitkevij <1553398+sitkevij@users.noreply.github.com>2020-11-07 17:22:11 -0800
committersitkevij <1553398+sitkevij@users.noreply.github.com>2020-11-07 17:22:11 -0800
commitfe166b07d82146e9f305a91cf1c32aa0961d34e4 (patch)
treed102711d1685732920a2088ffeef9d9e9b7168ed
parentd333b306812c35dee615542a4edff451b2b7d50a (diff)
#44 add tarpaulin support
-rw-r--r--.github/workflows/ci.yml58
-rw-r--r--.gitignore4
-rw-r--r--.tarpaulin.toml5
-rw-r--r--Makefile5
4 files changed, 72 insertions, 0 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..c5a0848
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -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
diff --git a/.gitignore b/.gitignore
index f6d549f..e87a0b4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,3 +10,7 @@
**/*.rs.bk
.DS_Store
+
+# ci code coverage
+tarpaulin-report.html
+cobertura.xml \ No newline at end of file
diff --git a/.tarpaulin.toml b/.tarpaulin.toml
new file mode 100644
index 0000000..d0e55d3
--- /dev/null
+++ b/.tarpaulin.toml
@@ -0,0 +1,5 @@
+[default]
+# Expected one of `Tests`, `Doctests`, `Benchmarks`, `Examples`, `Lib`, `Bins`, `AllTargets`
+run-types = ["Tests"]
+[report]
+out = ["Html", "Xml"]
diff --git a/Makefile b/Makefile
index 4f1d1df..69a5695 100644
--- a/Makefile
+++ b/Makefile
@@ -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/