-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
70 changed files
with
1,153 additions
and
674 deletions.
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
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
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,70 @@ | ||
name: Coverage | ||
on: | ||
pull_request_target: | ||
|
||
jobs: | ||
coverage: | ||
name: Collect | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
|
||
permissions: | ||
statuses: write | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- run: | | ||
sudo apt-get install protobuf-compiler | ||
- name: Install grcov | ||
run: | | ||
cargo install grcov | ||
grcov --version | ||
- name: Tests | ||
env: | ||
RUSTFLAGS: "-Cinstrument-coverage" | ||
LLVM_PROFILE_FILE: "target/coverage/%p-%m.profraw" | ||
run: | | ||
sudo -E $(command -v cargo) test --all-features | ||
# Fix permissions after sudo. | ||
sudo chown -R $(whoami) target/coverage/ | ||
- name: Collect coverage data | ||
run: | | ||
grcov . \ | ||
--source-dir . \ | ||
--binary-path ./target/debug/ \ | ||
--branch --ignore-not-existing \ | ||
--output-types html,markdown \ | ||
--keep-only 'crates/*' \ | ||
--output-path ./target/coverage/ | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: coverage | ||
path: target/coverage/html/ | ||
if-no-files-found: error | ||
|
||
- name: Publish job summary | ||
run: | | ||
echo "# Coverage" >> $GITHUB_STEP_SUMMARY | ||
cat target/coverage/markdown.md >> $GITHUB_STEP_SUMMARY | ||
- run: echo "coverage=$(cat target/coverage/markdown.md | grep 'Total coverage')" >> $GITHUB_OUTPUT | ||
id: coverage | ||
|
||
- name: Create commit status | ||
uses: actions/github-script@v6 | ||
if: success() | ||
with: | ||
script: | | ||
github.rest.repos.createCommitStatus({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
sha: context.sha, | ||
state: 'success', | ||
description: '${{ steps.coverage.outputs.coverage }}', | ||
}) |
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
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
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 |
---|---|---|
|
@@ -2,8 +2,8 @@ | |
name = "containerd-client" | ||
version = "0.4.0" | ||
authors = [ | ||
"Maksym Pavlenko <[email protected]>", | ||
"The containerd Authors", | ||
"Maksym Pavlenko <[email protected]>", | ||
"The containerd Authors", | ||
] | ||
description = "GRPC bindings to containerd APIs" | ||
keywords = ["containerd", "client", "grpc", "containers"] | ||
|
@@ -14,21 +14,33 @@ license.workspace = true | |
repository.workspace = true | ||
homepage.workspace = true | ||
|
||
[[example]] | ||
name = "container" | ||
path = "examples/container.rs" | ||
|
||
[[example]] | ||
name = "version" | ||
path = "examples/version.rs" | ||
|
||
[dependencies] | ||
tonic.workspace = true | ||
prost.workspace = true | ||
prost-types.workspace = true | ||
tokio = { workspace = true, optional = true } | ||
tonic.workspace = true | ||
tower = { workspace = true, optional = true } | ||
|
||
[build-dependencies] | ||
tonic-build.workspace = true | ||
|
||
[features] | ||
connect = ["tokio", "tower"] | ||
docs = [] | ||
|
||
# Technically Tonic doesn't require Tokio and Tower dependencies here. | ||
# However we need them to implement `connect` helper and it's highly unlikely | ||
# that Tonic will be used with any other async runtime (see https://github.com/hyperium/tonic/issues/152) | ||
# So we enable `connect` feature by default (use `--no-default-features` otherwise). | ||
default = ["connect"] | ||
|
||
[package.metadata.docs.rs] | ||
features = ["docs"] |
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
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
Oops, something went wrong.