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

ci: Split cargo-deny into its own job, add cargo-machete #15774

Merged
merged 3 commits into from Apr 1, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 22 additions & 6 deletions .github/workflows/test_rust.yml
Expand Up @@ -31,7 +31,7 @@ jobs:

build:
needs: changes
if: needs.changes.outputs.should_run== 'true'
if: needs.changes.outputs.should_run == 'true'
name: Test Rust ${{ matrix.rust_version }} / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.rust_version == 'nightly' || matrix.rust_version == 'beta' }}
Expand Down Expand Up @@ -103,7 +103,7 @@ jobs:

lints:
needs: changes
if: needs.changes.outputs.should_run== 'true'
if: needs.changes.outputs.should_run == 'true'
name: Lints with Rust ${{ matrix.rust_version }}
runs-on: ubuntu-22.04
continue-on-error: ${{ matrix.rust_version == 'nightly' || matrix.rust_version == 'beta' }}
Expand Down Expand Up @@ -133,15 +133,31 @@ jobs:
# Don't fail the build for clippy on nightly, since we get a lot of false-positives
run: cargo clippy --all --all-features --tests ${{ (matrix.rust_version != 'nightly' && '-- -D warnings') || '' }}

- name: Check licensing and duplicates in used crates
if: ${{ matrix.rust_version == 'stable' }}
uses: EmbarkStudios/cargo-deny-action@v1

- name: Check documentation
run: cargo doc --no-deps --all-features
env:
RUSTDOCFLAGS: -D warnings

dependencies:
needs: changes
if: needs.changes.outputs.should_run == 'true'
name: Check dependencies
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Check licenses, duplicates, and advisories
uses: EmbarkStudios/cargo-deny-action@v1

- name: Check unused dependencies
uses: bnjbvr/cargo-machete@main
# So the previous step failing doesn't prevent this one from running.
if: always()

check-required:
needs: changes
if: needs.changes.outputs.should_run == 'false'
Expand Down
8 changes: 0 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion exporter/Cargo.toml
Expand Up @@ -16,7 +16,6 @@ futures = "0.3"
ruffle_core = { path = "../core", features = ["deterministic", "default_font"] }
ruffle_render_wgpu = { path = "../render/wgpu", features = ["clap"] }
image = { version = "0.25.0", default-features = false, features = ["png"] }
log = "0.4"
walkdir = "2.5.0"
indicatif = "0.17"
rayon = "1.10.0"
Expand Down
1 change: 0 additions & 1 deletion render/canvas/Cargo.toml
Expand Up @@ -17,7 +17,6 @@ ruffle_web_common = { path = "../../web/common" }
wasm-bindgen = "=0.2.92"
ruffle_render = { path = "..", features = ["web"] }
swf = { path = "../../swf" }
downcast-rs = "1.2.0"

[dependencies.web-sys]
version = "0.3.69"
Expand Down
2 changes: 0 additions & 2 deletions render/naga-pixelbender/Cargo.toml
Expand Up @@ -14,7 +14,5 @@ workspace = true
ruffle_render = { path = "../" }
naga = { workspace = true }
naga_oil = { workspace = true }
tracing = { workspace = true }
anyhow = "1.0.81"
bitflags = "2.5.0"

1 change: 0 additions & 1 deletion render/webgl/Cargo.toml
Expand Up @@ -19,7 +19,6 @@ wasm-bindgen = "=0.2.92"
bytemuck = { version = "1.15.0", features = ["derive"] }
swf = { path = "../../swf" }
thiserror = "1.0"
downcast-rs = "1.2.0"

[dependencies.web-sys]
version = "0.3.69"
Expand Down
8 changes: 6 additions & 2 deletions render/wgpu/Cargo.toml
Expand Up @@ -15,7 +15,6 @@ wgpu = { workspace = true, features = ["naga-ir"] }
tracing = { workspace = true }
ruffle_render = { path = "..", features = ["tessellator", "wgpu"] }
bytemuck = { version = "1.15.0", features = ["derive"] }
raw-window-handle = "0.6.0"
clap = { version = "4.5.4", features = ["derive"], optional = true }
enum-map = "2.7.3"
fnv = "1.0.7"
Expand All @@ -24,7 +23,6 @@ image = { version = "0.25.0", default-features = false }
naga_oil = { workspace = true }
naga-agal = { path = "../naga-agal" }
naga-pixelbender = { path = "../naga-pixelbender" }
downcast-rs = "1.2.0"
profiling = { version = "1.0", default-features = false, optional = true }
lru = "0.12.3"
naga = { workspace = true }
Expand All @@ -44,3 +42,9 @@ render_debug_labels = []
render_trace = ["wgpu/trace"]
webgl = ["wgpu/webgl"]
profile-with-tracy = ["profiling", "profiling/profile-with-tracy"]

[package.metadata.cargo-machete]
ignored = [
# Not used directly, declared only to enable its `profile-with-tracy` feature.
"profiling"
]
1 change: 0 additions & 1 deletion tests/framework/Cargo.toml
Expand Up @@ -11,7 +11,6 @@ version.workspace = true
workspace = true

[dependencies]
futures = "0.3.30"
ruffle_core = { path = "../../core", features = ["deterministic", "timeline_debug", "avm_debug", "audio", "mp3", "default_font"] }
ruffle_render = { path = "../../render" }
ruffle_input_format = { path = "../input-format" }
Expand Down
6 changes: 6 additions & 0 deletions web/Cargo.toml
Expand Up @@ -74,3 +74,9 @@ features = [
"HtmlInputElement", "HtmlTextAreaElement", "KeyboardEvent", "Location", "PointerEvent",
"Request", "RequestInit", "Response", "Storage", "WheelEvent", "Window", "ReadableStream", "RequestCredentials"
]

[package.metadata.cargo-machete]
ignored = [
# Not used directly, declared only to enable its `js` feature.
"getrandom"
]