Add crates.io badge and coverage badge
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml
index 52bd3a4..2100a6e 100644
--- a/.github/workflows/rust.yml
+++ b/.github/workflows/rust.yml
@@ -18,9 +18,26 @@ jobs:
- uses: actions/checkout@v2
- name: Build
run: cargo build --verbose --all-features
- - name: Run tests
- run: cargo test --verbose --all-features
- - name: Codecov
- uses: codecov/codecov-action@v2.1.0
+
+ - name: Install stable toolchain
+ uses: actions-rs/toolchain@v1
+ with:
+ toolchain: stable
+ override: true
+
+ - name: Run cargo-tarpaulin
+ uses: actions-rs/tarpaulin@v0.1
+ with:
+ version: '0.15.0'
+ args: '-- --verbose --all-features --test-threads 1'
+
+ - name: Upload to codecov.io
+ uses: codecov/codecov-action@v2
+ with:
+ token: ${{secrets.CODECOV_TOKEN}}
+
+ - name: Archive code coverage results
+ uses: actions/upload-artifact@v1
with:
- token: ${{ secrets.CODECOV_TOKEN }}
+ name: code-coverage-report
+ path: cobertura.xml
\ No newline at end of file
diff --git a/README.md b/README.md
index 315c694..e7e351d 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
# totp-rs
-![Build Status](https://github.com/constantoine/totp-rs/workflows/Rust/badge.svg) [![docs](https://docs.rs/totp-rs/badge.svg)](https://docs.rs/totp-rs)
+![Build Status](https://github.com/constantoine/totp-rs/workflows/Rust/badge.svg) [![docs](https://docs.rs/totp-rs/badge.svg)](https://docs.rs/totp-rs) [![](https://img.shields.io/crates/v/totp-rs.svg)](https://crates.io/crates/totp-rs) [![codecov](https://codecov.io/gh/constantoine/totp-rs/branch/master/graph/badge.svg?token=Q50RAIFVWZ)](https://codecov.io/gh/constantoine/totp-rs)
This library permits the creation of 2FA authentification tokens per TOTP, the verification of said tokens, with configurable time skew, validity time of each token, algorithm and number of digits! Default features are kept as lightweight as possible to ensure small binaries and short compilation time