-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add utils yaml, coverage-utils and modify utils tarpaulin.toml
- Loading branch information
1 parent
3b6e51f
commit 5deebd4
Showing
3 changed files
with
93 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: Util Test Coverage | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
utils-coverage: | ||
|
||
name: tarpaulin Test | ||
runs-on: ubuntu-latest | ||
container: | ||
image: xd009642/tarpaulin:0.27.1-nightly | ||
options: --security-opt seccomp=unconfined | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Generate code coverage | ||
run: | | ||
./scripts/coverage-utils.sh | ||
- name: Upload utils coverage to codecov.io | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
directory: ./utils/target/tarpaulin-reports | ||
file: ./utils/target/tarpaulin-reports/cobertura.xml | ||
flags: utils | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
- name: Upload bip32_derivation-coverage to codecov.io | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
directory: ./utils/target/tarpaulin-reports/bip32-key-derivation-coverage | ||
file: ./utils/target/tarpaulin-reports/bip32-key-derivation-coverage/cobertura.xml | ||
flags: bip32_derivation-coverage | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
- name: Upload buffer_sv2-coverage to codecov.io | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
directory: ./utils/target/tarpaulin-reports/buffer-coverage | ||
file: ./utils/target/tarpaulin-reports/buffer-coverage/cobertura.xml | ||
flags: buffer_sv2-coverage | ||
|
||
token: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
- name: Upload error_handling-coverage to codecov.io | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
directory: ./utils/target/tarpaulin-reports/error-handling-coverage | ||
file: ./utils/target/tarpaulin-reports/error-handling-coverage/cobertura.xml | ||
flags: error_handling-coverage | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
- name: Upload key-utils-coverage to codecov.io | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
directory: ./utils/target/tarpaulin-reports/key-utils-coverage | ||
file: ./utils/target/tarpaulin-reports/key-utils-coverage/cobertura.xml | ||
flags: key-utils-coverage | ||
token: ${{ secrets.CODECOV_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
|
||
tarpaulin() { | ||
crate_name=$1 | ||
output_dir="target/tarpaulin-reports/$crate_name" | ||
mkdir -p "$output_dir" | ||
cargo +nightly tarpaulin --verbose --out Xml --output-dir "$output_dir" --all-features | ||
} | ||
|
||
cd utils | ||
tarpaulin | ||
|
||
crates=( | ||
"buffer" | ||
"error-handling" | ||
"key-utils" | ||
"bip32-key-derivation" | ||
) | ||
|
||
for crate in "${crates[@]}"; do | ||
echo "Running Tarpaulin for $crate..." | ||
crate_name=$(basename "$crate") | ||
cd "$crate" || exit 1 | ||
tarpaulin "$crate_name-coverage" | ||
cd - || exit 1 | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
[default] | ||
run-types = [ "Lib" ] | ||
timeout = "120s" | ||
fail-under = 7 | ||
fail-under = 0 | ||
|
||
[report] | ||
out = ["Xml"] |