Skip to content

Commit ebe2416

Browse files
authored
ci: use cargo deny (#6931)
1 parent 01e04da commit ebe2416

File tree

9 files changed

+41
-30
lines changed

9 files changed

+41
-30
lines changed

.github/workflows/audit.yml

+6-12
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,12 @@ permissions:
1313
contents: read
1414

1515
jobs:
16-
security-audit:
16+
cargo-deny:
1717
permissions:
18-
checks: write # for rustsec/audit-check to create check
19-
contents: read # for actions/checkout to fetch code
20-
issues: write # for rustsec/audit-check to create issues
18+
checks: write
19+
contents: read
20+
issues: write
2121
runs-on: ubuntu-latest
22-
if: "!contains(github.event.head_commit.message, 'ci skip')"
2322
steps:
24-
- uses: actions/checkout@v4
25-
26-
- name: Audit Check
27-
# https://github.com/rustsec/audit-check/issues/2
28-
uses: rustsec/audit-check@master
29-
with:
30-
token: ${{ secrets.GITHUB_TOKEN }}
23+
- uses: actions/checkout@v4
24+
- uses: EmbarkStudios/cargo-deny-action@v2

.github/workflows/pr-audit.yml

+3-12
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,8 @@ permissions:
1616
contents: read
1717

1818
jobs:
19-
security-audit:
19+
cargo-deny:
2020
runs-on: ubuntu-latest
21-
if: "!contains(github.event.head_commit.message, 'ci skip')"
2221
steps:
23-
- uses: actions/checkout@v4
24-
25-
- name: Install cargo-audit
26-
run: cargo install cargo-audit
27-
28-
- name: Generate lockfile
29-
run: cargo generate-lockfile
30-
31-
- name: Audit dependencies
32-
run: cargo audit
22+
- uses: actions/checkout@v4
23+
- uses: EmbarkStudios/cargo-deny-action@v2

benches/Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name = "benches"
33
version = "0.0.0"
44
publish = false
55
edition = "2021"
6+
license = "MIT"
67

78
[features]
89
test-util = ["tokio/test-util"]
@@ -15,7 +16,7 @@ rand_chacha = "0.3"
1516

1617
[dev-dependencies]
1718
tokio-util = { version = "0.7.0", path = "../tokio-util", features = ["full"] }
18-
tokio-stream = { path = "../tokio-stream" }
19+
tokio-stream = { version = "0.1", path = "../tokio-stream" }
1920

2021
[target.'cfg(unix)'.dependencies]
2122
libc = "0.2.42"

deny.toml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# https://embarkstudios.github.io/cargo-deny/cli/init.html
2+
3+
[graph]
4+
all-features = true
5+
6+
[licenses]
7+
allow = [
8+
"MIT",
9+
"Apache-2.0",
10+
]
11+
exceptions = [
12+
{ allow = ["Unicode-DFS-2016"], crate = "unicode-ident" },
13+
]
14+
15+
[bans]
16+
multiple-versions = "allow"
17+
wildcards = "deny"
18+
19+
[sources]
20+
unknown-registry = "deny"
21+
unknown-git = "deny"

examples/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name = "examples"
33
version = "0.0.0"
44
publish = false
55
edition = "2021"
6+
license = "MIT"
67

78
# If you copy one of the examples into a new project, you should be using
89
# [dependencies] instead, and delete the **path**.

stress-test/Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ name = "stress-test"
33
version = "0.1.0"
44
authors = ["Tokio Contributors <[email protected]>"]
55
edition = "2021"
6+
license = "MIT"
67
publish = false
78

89
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
910

1011
[dependencies]
11-
tokio = { path = "../tokio/", features = ["full"] }
12+
tokio = { version = "1.0.0", path = "../tokio/", features = ["full"] }
1213

1314
[dev-dependencies]
1415
rand = "0.8"

tests-build/Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@ name = "tests-build"
33
version = "0.1.0"
44
authors = ["Tokio Contributors <[email protected]>"]
55
edition = "2021"
6+
license = "MIT"
67
publish = false
78

89
[features]
910
full = ["tokio/full"]
1011
rt = ["tokio/rt", "tokio/macros"]
1112

1213
[dependencies]
13-
tokio = { path = "../tokio", optional = true }
14+
tokio = { version = "1.0.0", path = "../tokio", optional = true }
1415

1516
[dev-dependencies]
1617
trybuild = "1.0"

tests-integration/Cargo.toml

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name = "tests-integration"
33
version = "0.1.0"
44
authors = ["Tokio Contributors <[email protected]>"]
55
edition = "2021"
6+
license = "MIT"
67
publish = false
78

89
[[bin]]
@@ -55,8 +56,8 @@ rt = ["tokio/rt"]
5556
rt-multi-thread = ["rt", "tokio/rt-multi-thread"]
5657

5758
[dependencies]
58-
tokio = { path = "../tokio" }
59-
tokio-test = { path = "../tokio-test", optional = true }
59+
tokio = { version = "1.0.0", path = "../tokio" }
60+
tokio-test = { version = "0.4", path = "../tokio-test", optional = true }
6061
doc-comment = "0.3.1"
6162
futures = { version = "0.3.0", features = ["async-await"] }
6263
bytes = "1.0.0"

tokio-stream/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ tokio-util = { version = "0.7.0", path = "../tokio-util", optional = true }
4545
tokio = { version = "1.2.0", path = "../tokio", features = ["full", "test-util"] }
4646
async-stream = "0.3"
4747
parking_lot = "0.12.0"
48-
tokio-test = { path = "../tokio-test" }
48+
tokio-test = { version = "0.4", path = "../tokio-test" }
4949
futures = { version = "0.3", default-features = false }
5050

5151
[package.metadata.docs.rs]

0 commit comments

Comments
 (0)