mirror of
https://github.com/eliasstepanik/imgui-rs.git
synced 2026-01-23 03:18:34 +00:00
commit
2db100bf8f
11
.github/workflows/ci.yml
vendored
11
.github/workflows/ci.yml
vendored
@ -45,8 +45,12 @@ jobs:
|
|||||||
${{ runner.os }}-target-lint-stable-${{ hashFiles('**/Cargo.toml') }}
|
${{ runner.os }}-target-lint-stable-${{ hashFiles('**/Cargo.toml') }}
|
||||||
${{ runner.os }}-target-lint-stable-
|
${{ runner.os }}-target-lint-stable-
|
||||||
${{ runner.os }}-target-lint-
|
${{ runner.os }}-target-lint-
|
||||||
|
|
||||||
|
# default
|
||||||
- run: cargo clippy --workspace --all-targets
|
- run: cargo clippy --workspace --all-targets
|
||||||
# supported winit versions
|
# with only docking
|
||||||
|
- run: cargo clippy --workspace --all-targets --features docking
|
||||||
|
# supported winit versions (with otherwise default features)
|
||||||
- run: cargo clippy --manifest-path imgui-winit-support/Cargo.toml --all-features --all-targets
|
- run: cargo clippy --manifest-path imgui-winit-support/Cargo.toml --all-features --all-targets
|
||||||
- run: cargo clippy --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-19 --all-targets
|
- run: cargo clippy --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-19 --all-targets
|
||||||
- run: cargo clippy --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-20 --all-targets
|
- run: cargo clippy --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-20 --all-targets
|
||||||
@ -54,6 +58,7 @@ jobs:
|
|||||||
- run: cargo clippy --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-23/default --all-targets
|
- run: cargo clippy --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-23/default --all-targets
|
||||||
- run: cargo clippy --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-24/default --all-targets
|
- run: cargo clippy --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-24/default --all-targets
|
||||||
- run: cargo clippy --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-25/default --all-targets
|
- run: cargo clippy --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-25/default --all-targets
|
||||||
|
|
||||||
rustfmt:
|
rustfmt:
|
||||||
name: Check rustfmt
|
name: Check rustfmt
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -132,12 +137,12 @@ jobs:
|
|||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-target-test-${{ matrix.rust }}-${{ hashFiles('**/Cargo.toml') }}
|
${{ runner.os }}-target-test-${{ matrix.rust }}-${{ hashFiles('**/Cargo.toml') }}
|
||||||
${{ runner.os }}-target-test-${{ matrix.rust }}-
|
${{ runner.os }}-target-test-${{ matrix.rust }}-
|
||||||
|
|
||||||
- run: cargo test --workspace --all-targets
|
- run: cargo test --workspace --all-targets
|
||||||
|
- run: cargo test --workspace --all-targets --features docking
|
||||||
- run: cargo test --workspace --doc
|
- run: cargo test --workspace --doc
|
||||||
# run to check for lint problems
|
# run to check for lint problems
|
||||||
- run: cargo doc
|
- run: cargo doc
|
||||||
# - run: cargo test --manifest-path imgui-gfx-examples/Cargo.toml --no-default-features --features directx
|
|
||||||
# if: runner.os == 'Windows'
|
|
||||||
- run: cargo test --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-19
|
- run: cargo test --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-19
|
||||||
- run: cargo test --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-20
|
- run: cargo test --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-20
|
||||||
- run: cargo test --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-22
|
- run: cargo test --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-22
|
||||||
|
|||||||
@ -33,7 +33,7 @@ pub struct DrawData {
|
|||||||
pub framebuffer_scale: [f32; 2],
|
pub framebuffer_scale: [f32; 2],
|
||||||
|
|
||||||
#[cfg(feature = "docking")]
|
#[cfg(feature = "docking")]
|
||||||
OwnerViewport: *mut sys::ImGuiViewport,
|
owner_viewport: *mut sys::ImGuiViewport,
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe impl RawCast<sys::ImDrawData> for DrawData {}
|
unsafe impl RawCast<sys::ImDrawData> for DrawData {}
|
||||||
|
|||||||
@ -32,11 +32,18 @@ fn try_main() -> Result<()> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn lint_all() -> Result<()> {
|
fn lint_all() -> Result<()> {
|
||||||
|
// Lint with only default, only docking, and only freetype
|
||||||
xshell::cmd!("cargo clippy --workspace --all-targets").run()?;
|
xshell::cmd!("cargo clippy --workspace --all-targets").run()?;
|
||||||
|
xshell::cmd!("cargo clippy --workspace --all-targets --features docking").run()?;
|
||||||
|
xshell::cmd!("cargo clippy --workspace --all-targets --features freetype").run()?;
|
||||||
|
|
||||||
|
// Lint winit with all features
|
||||||
xshell::cmd!(
|
xshell::cmd!(
|
||||||
"cargo clippy --manifest-path imgui-winit-support/Cargo.toml --all-features --all-targets"
|
"cargo clippy --manifest-path imgui-winit-support/Cargo.toml --all-features --all-targets"
|
||||||
)
|
)
|
||||||
.run()?;
|
.run()?;
|
||||||
|
|
||||||
|
// Lint with various winit versions
|
||||||
let winits = &[
|
let winits = &[
|
||||||
"winit-19",
|
"winit-19",
|
||||||
"winit-20",
|
"winit-20",
|
||||||
@ -48,13 +55,22 @@ fn lint_all() -> Result<()> {
|
|||||||
for &winit in winits {
|
for &winit in winits {
|
||||||
xshell::cmd!("cargo clippy --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features {winit} --all-targets").run()?;
|
xshell::cmd!("cargo clippy --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features {winit} --all-targets").run()?;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check formatting
|
||||||
xshell::cmd!("cargo fmt --all -- --check").run()?;
|
xshell::cmd!("cargo fmt --all -- --check").run()?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn test_all() -> Result<()> {
|
fn test_all() -> Result<()> {
|
||||||
|
// Test with default/docking/freetype features
|
||||||
xshell::cmd!("cargo test --workspace --all-targets").run()?;
|
xshell::cmd!("cargo test --workspace --all-targets").run()?;
|
||||||
|
xshell::cmd!("cargo test --workspace --all-targets --features docking").run()?;
|
||||||
|
xshell::cmd!("cargo test --workspace --all-targets --features freetype").run()?;
|
||||||
|
|
||||||
|
// Test doc examples
|
||||||
xshell::cmd!("cargo test --workspace --doc").run()?;
|
xshell::cmd!("cargo test --workspace --doc").run()?;
|
||||||
|
|
||||||
|
// Test with various winit versions
|
||||||
let winits = &[
|
let winits = &[
|
||||||
"winit-19",
|
"winit-19",
|
||||||
"winit-20",
|
"winit-20",
|
||||||
@ -66,6 +82,7 @@ fn test_all() -> Result<()> {
|
|||||||
for &winit in winits {
|
for &winit in winits {
|
||||||
xshell::cmd!("cargo test --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features {winit} --all-targets").run()?;
|
xshell::cmd!("cargo test --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features {winit} --all-targets").run()?;
|
||||||
}
|
}
|
||||||
|
// Run heavy tests in release mode
|
||||||
xshell::cmd!("cargo test -p imgui --release -- --ignored").run()?;
|
xshell::cmd!("cargo test -p imgui --release -- --ignored").run()?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user