-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: use cargo deny #6931
ci: use cargo deny #6931
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,17 +16,8 @@ permissions: | |
contents: read | ||
|
||
jobs: | ||
security-audit: | ||
cargo-deny: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we are doing the same thing with both files, I think it would be better to merge them. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The docs recommend using this: name: CI
on: [push, pull_request]
jobs:
cargo-deny:
runs-on: ubuntu-22.04
strategy:
matrix:
checks:
- advisories
- bans licenses sources
# Prevent sudden announcement of a new advisory from failing ci:
continue-on-error: ${{ matrix.checks == 'advisories' }}
steps:
- uses: actions/checkout@v3
- uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check ${{ matrix.checks }} Perhaps we should do this in the toml for master, but keep it as-is on PRs? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Hmm. This will cause the advisory to be ignored until someone next opens a PR that edits Cargo.toml, right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess that depends on whether we get an email on error ... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have an image that continue-on-error treats failures the same as successes, but in practice I have rarely used it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, this PR is sufficient as-is to address the problem of broken CI, so I think it is fine to leave the fine tuning to future PRs. |
||
runs-on: ubuntu-latest | ||
if: "!contains(github.event.head_commit.message, 'ci skip')" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We never used that 🤷♀️ |
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install cargo-audit | ||
run: cargo install cargo-audit | ||
|
||
- name: Generate lockfile | ||
run: cargo generate-lockfile | ||
|
||
- name: Audit dependencies | ||
run: cargo audit | ||
- uses: actions/checkout@v4 | ||
- uses: EmbarkStudios/cargo-deny-action@v2 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# https://embarkstudios.github.io/cargo-deny/cli/init.html | ||
|
||
[graph] | ||
all-features = true | ||
|
||
[licenses] | ||
allow = [ | ||
"MIT", | ||
"Apache-2.0", | ||
] | ||
exceptions = [ | ||
{ allow = ["Unicode-DFS-2016"], crate = "unicode-ident" }, | ||
] | ||
|
||
[bans] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't usually have bans and sources sections, are the defaults not good enough? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's spamming warnings about some duplicate versions of windows-sys. |
||
multiple-versions = "allow" | ||
wildcards = "deny" | ||
|
||
[sources] | ||
unknown-registry = "deny" | ||
unknown-git = "deny" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,12 +3,13 @@ name = "stress-test" | |
version = "0.1.0" | ||
authors = ["Tokio Contributors <[email protected]>"] | ||
edition = "2021" | ||
license = "MIT" | ||
publish = false | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
tokio = { path = "../tokio/", features = ["full"] } | ||
tokio = { version = "1.0.0", path = "../tokio/", features = ["full"] } | ||
|
||
[dev-dependencies] | ||
rand = "0.8" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,14 +3,15 @@ name = "tests-build" | |
version = "0.1.0" | ||
authors = ["Tokio Contributors <[email protected]>"] | ||
edition = "2021" | ||
license = "MIT" | ||
publish = false | ||
|
||
[features] | ||
full = ["tokio/full"] | ||
rt = ["tokio/rt", "tokio/macros"] | ||
|
||
[dependencies] | ||
tokio = { path = "../tokio", optional = true } | ||
tokio = { version = "1.0.0", path = "../tokio", optional = true } | ||
|
||
[dev-dependencies] | ||
trybuild = "1.0" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ name = "tests-integration" | |
version = "0.1.0" | ||
authors = ["Tokio Contributors <[email protected]>"] | ||
edition = "2021" | ||
license = "MIT" | ||
publish = false | ||
|
||
[[bin]] | ||
|
@@ -55,8 +56,8 @@ rt = ["tokio/rt"] | |
rt-multi-thread = ["rt", "tokio/rt-multi-thread"] | ||
|
||
[dependencies] | ||
tokio = { path = "../tokio" } | ||
tokio-test = { path = "../tokio-test", optional = true } | ||
tokio = { version = "1.0.0", path = "../tokio" } | ||
tokio-test = { version = "0.4", path = "../tokio-test", optional = true } | ||
doc-comment = "0.3.1" | ||
futures = { version = "0.3.0", features = ["async-await"] } | ||
bytes = "1.0.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EmbarkStudios/cargo-deny-action action does not seem create issues (EmbarkStudios/cargo-deny-action#64), so these permissions are probably not needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean, not like the rustsec one has ever created an issue ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(The last time rustsec action created an issue in this repository was two years ago, which IIRC was before fine-grained permission settings in GitHub actions were supported.)
https://github.com/tokio-rs/tokio/issues?q=is%3Aissue+author%3Aapp%2Fgithub-actions