add codecov + tarpaulin in ci
@@ -21,7 +21,6 @@ jobs:
steps:
- uses: actions/checkout@v3
-
- name: Restore cargo cache
uses: actions/cache@v3
with:
@@ -64,3 +63,31 @@ jobs:
toolchain: stable
components: rustfmt
- run: cargo fmt -- --check
+
+ coverage:
+ name: code coverage
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - name: Install Rust
+ uses: actions-rs/toolchain@v1
+ with:
+ toolchain: stable
+ components: rustfmt
+
+ - name: Run cargo-tarpaulin
+ uses: actions-rs/tarpaulin@v0.1
+ with:
+ version: "0.15.0"
+ args: "-- --test-threads 1"
+
+ - name: Upload to codecov.io
+ uses: codecov/codecov-action@v1.0.2
+ with:
+ token: ${{secrets.CODECOV_TOKEN}}
+
+ - name: Archive code coverage results
+ uses: actions/upload-artifact@v1
+ with:
+ name: code-coverage-report
+ path: cobertura.xml
