Skip to content
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

Add cargo-machete and remove unnecessary dependencies 🔪 #890

Merged
merged 3 commits into from
May 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions .github/workflows/full-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ env:
# Local variables
# Note: using variables is limited at the moment, see https://github.com/actions/runner/issues/480
GDRUST_FEATURES: "gdnative/async,gdnative/serde,gdnative_bindings_generator/debug"
CARGO_DENY_VERSION: "0.11.0"
CARGO_DINGHY_VERSION: "0.4.68"
CARGO_DENY_VERSION: "0.11.4"
CARGO_DINGHY_VERSION: "0.4.71"
CARGO_MACHETE_VERSION: "0.3"

on:
push:
Expand Down Expand Up @@ -80,21 +81,33 @@ jobs:
- name: "Check clippy"
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

cargo-deny:
cargo-deny-machete:
runs-on: ubuntu-latest
needs: rustfmt
steps:
- uses: actions/checkout@v2

# Deny
# Note: manually downloading is ~30s faster than https://github.com/EmbarkStudios/cargo-deny-action
- name: "Install cargo-deny"
run: |
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
tar -zxvf cargo-deny.tar.gz
mkdir -p $HOME/.cargo/bin
mv cargo-deny-$CARGO_DENY_VERSION-x86_64-unknown-linux-musl/cargo-deny $HOME/.cargo/bin
- name: "Check cargo-deny"
- name: "Deny non-conforming dependencies"
run: cargo deny check --config tools/deny.toml

# Machete
- name: "Install cargo-machete"
uses: baptiste0928/cargo-install@v1
with:
crate: cargo-machete
version: ${{ env.CARGO_MACHETE_VERSION }}
- name: "Use machete to cut down dependencies"
run: cargo machete


test:
name: test-${{ matrix.os.name }}${{ matrix.rust.postfix }}
needs: rustfmt
Expand Down Expand Up @@ -285,7 +298,7 @@ jobs:
needs:
#- rustfmt
- clippy
- cargo-deny
- cargo-deny-machete
- test
- integration-test-godot
- build-release
Expand Down
1 change: 0 additions & 1 deletion bindings-generator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ custom-godot = ["which"]

[dependencies]
heck = "0.4"
memchr = "2"
miniserde = "0.1.16"
proc-macro2 = "1"
quote = "1"
Expand Down
1 change: 0 additions & 1 deletion gdnative-async/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ gdnative-core = { path = "../gdnative-core", version = "=0.10.0" }
gdnative-bindings = { path = "../gdnative-bindings", version = "=0.10.0" }
atomic-waker = "1"
crossbeam-channel = "0.5"
crossbeam-utils = "0.8"
futures-task = "0.3"
once_cell = "1"
parking_lot = "0.12"
Expand Down
2 changes: 0 additions & 2 deletions gdnative-bindings/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ one-class-one-file = []
custom-godot = ["gdnative_bindings_generator/custom-godot"]

[dependencies]
gdnative-sys = { path = "../gdnative-sys", version = "=0.10.0" }
gdnative-core = { path = "../gdnative-core", version = "=0.10.0" }
bitflags = "1"
libc = "0.2"

[build-dependencies]
Expand Down
4 changes: 4 additions & 0 deletions gdnative-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ proc-macro2 = "1"
quote = "1"
miniserde = "0.1.16"
semver = "1"

# False positives found by cargo-machete
[package.metadata.cargo-machete]
ignored = ["libc"]
2 changes: 0 additions & 2 deletions test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ custom-godot = ["gdnative/custom-godot"]

[dependencies]
gdnative = { path = "../gdnative", features = ["gd-test", "serde", "async"] }
gdnative-derive = { path = "../gdnative-derive" }
approx = "0.5"
ron = "0.7"
serde = "1"
Expand All @@ -26,4 +25,3 @@ bincode = "1"
serde_yaml = "0.8.23"
rmp-serde = "1"
futures = "0.3"
once_cell = "1"