Skip to content

Commit 2c685ab

Browse files
bors[bot]Bromeon
andauthored
Merge #849
849: Add cargo-deny to CI r=Bromeon a=Bromeon [**cargo-deny**](https://github.com/EmbarkStudios/cargo-deny) is a tool that scans the dependency tree and checks for: * RustSec [security vulnerabilities](https://github.com/rustsec/advisory-db) * unmaintained/yanked crates * crates from non-approved registries (e.g. Git dependencies) * incompatible/disallowed licenses * banned crates It's not something that we _absolutely_ need. If it negatively affects CI, we can also not add it or remove it again in the future. Possible alternatives: * [cargo-audit](https://github.com/RustSec/rustsec/tree/main/cargo-audit) -- seems to have less functionality than cargo-deny * GitHub's [dependabot](https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/about-dependabot-version-updates) -- checks for updates. While it partially overlaps with cargo-deny, I think the two complement each other. I've set the rules rather strict for now (see 2nd commit), because a CI passing with warnings will never be noticed. If it limits us, we can continuously add exceptions or soften the rules. Co-authored-by: Jan Haller <[email protected]>
2 parents 685db31 + 93bce89 commit 2c685ab

File tree

13 files changed

+238
-28
lines changed

13 files changed

+238
-28
lines changed

.github/workflows/full-ci.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ env:
3333
# Local variables
3434
# Note: using variables is limited at the moment, see https://github.com/actions/runner/issues/480
3535
GDRUST_FEATURES: "gdnative/async,gdnative/serde"
36+
CARGO_DENY_VERSION: "0.11.0"
3637

3738
on:
3839
push:
@@ -78,6 +79,21 @@ jobs:
7879
- name: "Check clippy"
7980
run: cargo clippy --workspace --features ${GDRUST_FEATURES} -- -D clippy::style -D clippy::complexity -D clippy::perf -D clippy::dbg_macro -D clippy::todo -D clippy::unimplemented;
8081

82+
cargo-deny:
83+
runs-on: ubuntu-latest
84+
needs: rustfmt
85+
steps:
86+
- uses: actions/checkout@v2
87+
# Note: manually downloading is ~30s faster than https://github.com/EmbarkStudios/cargo-deny-action
88+
- name: "Install cargo-deny"
89+
run: |
90+
wget --no-verbose https://github.com/EmbarkStudios/cargo-deny/releases/download/$CARGO_DENY_VERSION/cargo-deny-$CARGO_DENY_VERSION-x86_64-unknown-linux-musl.tar.gz -O cargo-deny.tar.gz
91+
tar -zxvf cargo-deny.tar.gz
92+
mkdir -p $HOME/.cargo/bin
93+
mv cargo-deny-$CARGO_DENY_VERSION-x86_64-unknown-linux-musl/cargo-deny $HOME/.cargo/bin
94+
- name: "Check cargo-deny"
95+
run: cargo deny check --config tools/deny.toml
96+
8197
test:
8298
name: test-${{ matrix.os.name }}${{ matrix.rust.postfix }}
8399
needs: rustfmt
@@ -271,6 +287,7 @@ jobs:
271287
needs:
272288
#- rustfmt
273289
- clippy
290+
- cargo-deny
274291
- test
275292
- integration-test-godot
276293
- build-release

examples/array_export/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ version = "0.1.0"
44
authors = ["The godot-rust developers"]
55
publish = false
66
edition = "2018"
7+
license = "MIT"
78

89
[lib]
910
crate-type = ["cdylib"]

examples/dodge_the_creeps/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ version = "0.1.0"
44
authors = ["The godot-rust developers"]
55
publish = false
66
edition = "2018"
7+
license = "MIT"
78

89
[lib]
910
crate-type = ["cdylib"]

examples/hello_world/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ version = "0.1.0"
44
authors = ["The godot-rust developers"]
55
publish = false
66
edition = "2018"
7+
license = "MIT"
78

89
[lib]
910
crate-type = ["cdylib"]

examples/native_plugin/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ version = "0.1.0"
44
authors = ["The godot-rust developers"]
55
publish = false
66
edition = "2018"
7+
license = "MIT"
78

89
[lib]
910
crate-type = ["cdylib"]

examples/resource/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ version = "0.1.0"
44
authors = ["The godot-rust developers"]
55
publish = false
66
edition = "2018"
7+
license = "MIT"
78

89
[lib]
910
crate-type = ["cdylib"]

examples/rpc/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ version = "0.1.0"
44
authors = ["The godot-rust developers"]
55
publish = false
66
edition = "2018"
7+
license = "MIT"
78

89
[lib]
910
crate-type = ["cdylib"]

examples/scene_create/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ version = "0.1.0"
44
authors = ["The godot-rust developers"]
55
publish = false
66
edition = "2018"
7+
license = "MIT"
78

89
[lib]
910
crate-type = ["cdylib"]

examples/signals/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ version = "0.1.0"
44
authors = ["The godot-rust developers"]
55
edition = "2018"
66
publish = false
7+
license = "MIT"
78

89
[lib]
910
crate-type = ["cdylib"]

examples/spinning_cube/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ version = "0.1.0"
44
authors = ["The godot-rust developers"]
55
publish = false
66
edition = "2018"
7+
license = "MIT"
78

89
[lib]
910
crate-type = ["cdylib"]

0 commit comments

Comments
 (0)