Reconfigure / rename CI jobs (#616)
* Reconfigure / rename CI jobs * Fix build when block_layout feature is used without flexbox feature * Rename and reorder jobs
Delta semántico
Ninguna definición cambió: el cambio es de texto, documentación o datos.
3 archivos · +36 −34
- .github/workflows/ci.yml +34 −32
- Cargo.toml +1 −1
- src/geometry.rs +1 −1
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 613b4f43e..2bc4db5b4 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -6,22 +6,13 @@ on:
- 0.2.x
- 0.3.x
-name: Continuous integration
+name: CI
env:
RUSTDOCFLAGS: "-D warnings"
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: "sparse"
jobs:
- # None
- test-features-none:
- name: "Test Suite [Features: None]"
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - uses: dtolnay/rust-toolchain@stable
- - run: cargo build --no-default-features
- - run: cargo test --no-default-features --features taffy_tree
# MSRV check.
# Taffy only guarantees "latest stable". However we have this check here to ensure that we advertise
@@ -30,7 +21,7 @@ jobs:
# We only run `cargo build` (not `cargo test`) so as to avoid requiring dev-dependencies to build with the MSRV
# version. Building is likely sufficient as runtime errors varying between rust versions is very unlikely.
test-features-msrv:
- name: "Test Suite [Features: Default] (Rust 1.65)"
+ name: "MSRV Build [Rust 1.65]"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
@@ -39,9 +30,19 @@ jobs:
toolchain: 1.65
- run: cargo build
+ # No features
+ test-features-none:
+ name: "Test Suite [no features]"
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - uses: dtolnay/rust-toolchain@stable
+ - run: cargo build --no-default-features
+ - run: cargo test --no-default-features --features taffy_tree
+
# Default
test-features-default:
- name: "Test Suite [Features: Default]"
+ name: "Test Suite [default features]"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
@@ -50,7 +51,7 @@ jobs:
- run: cargo test
test-features-default-with-serde:
- name: "Test Suite [Features: Default + serde]"
+ name: "Test Suite [default + serde]"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
@@ -59,7 +60,7 @@ jobs:
- run: cargo test --features serde
test-features-default-except-content-size:
- name: "Test Suite [Features: Default except content_size]"
+ name: "Test Suite [default except content_size]"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
@@ -68,7 +69,7 @@ jobs:
- run: cargo test --no-default-features --features std,taffy_tree,grid,flexbox,block_layout
test-features-no-grid-nor-flexbox:
- name: "Test Suite [Features: std (no grid or flexbox)]"
+ name: "Test Suite [std (no algorithms)]"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
@@ -77,9 +78,9 @@ jobs:
- run: cargo build --no-default-features --features std,taffy_tree
- run: cargo test --no-default-features --features std,taffy_tree
- # Flexbox
+ # With std feature
test-features-flexbox:
- name: "Test Suite [Features: flexbox + std]"
+ name: "Test Suite [std + flexbox]"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
@@ -88,9 +89,8 @@ jobs:
- run: cargo build --no-default-features --features flexbox,std,taffy_tree
- run: cargo test --no-default-features --features flexbox,std,taffy_tree
- # Grid
test-features-grid:
- name: "Test Suite [Features: grid + std]"
+ name: "Test Suite [std + grid]"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
@@ -99,35 +99,37 @@ jobs:
- run: cargo build --no-default-features --features grid,std,taffy_tree
- run: cargo test --no-default-features --features grid,std,taffy_tree
- test-features-grid-with-alloc:
- name: "Test Suite [Features: grid + alloc]"
+ test-features-block:
+ name: "Test Suite [std + block)]"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- - run: cargo build --no-default-features --features alloc,grid
- - run: cargo build --no-default-features --features alloc,grid,taffy_tree
- - run: cargo test --no-default-features --features alloc,grid,taffy_tree
+ - run: cargo build --no-default-features --features block_layout,std
+ - run: cargo build --no-default-features --features block_layout,std,taffy_tree
+ - run: cargo test --no-default-features --features block_layout,std,taffy_tree
- test-features-alloc:
- name: "Test Suite [Features: alloc]"
+ # With alloc feature
+
+ test-features-grid-with-alloc:
+ name: "Test Suite [alloc + no algorithms]"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --no-default-features --features alloc
- run: cargo build --no-default-features --features alloc,taffy_tree
- - run: cargo test --no-default-features --features alloc,taffy_tree
+ - run: cargo test --no-default-features --features alloc,taffy_tree
- test-features-default-no-grid:
- name: "Test Suite [Features: std (no grid)]"
+ test-features-alloc:
+ name: "Test Suite [alloc + all algorithms]"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- - run: cargo build --no-default-features --features std
- - run: cargo build --no-default-features --features std,taffy_tree
- - run: cargo test --no-default-features --features std,taffy_tree
+ - run: cargo build --no-default-features --features alloc,grid,flexbox,block_layout
+ - run: cargo build --no-default-features --features alloc,grid,flexbox,block_layout,taffy_tree
+ - run: cargo test --no-default-features --features alloc,grid,flexbox,block_layout,taffy_tree
fmt:
name: Rustfmt
diff --git a/Cargo.toml b/Cargo.toml
index 74a69d405..8564cb7b7 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -50,7 +50,7 @@ serde = ["dep:serde"]
std = ["num-traits/std", "grid?/std", "serde?/std", "slotmap?/std"]
# Allow Taffy to depend on the alloc library
alloc = ["serde?/alloc"]
-# Internal featyre for debugging
+# Internal feature for debugging
debug = ["std"]
# Internal feature for profiling
profile = ["std"]
diff --git a/src/geometry.rs b/src/geometry.rs
index 497989ff0..60c31bfaf 100644
--- a/src/geometry.rs
+++ b/src/geometry.rs
@@ -144,7 +144,7 @@ impl<T> Rect<T> {
/// When applied to the left and right sides, the width is used
/// as the second parameter of `f`.
/// When applied to the top or bottom sides, the height is used instead.
- #[cfg(feature = "flexbox")]
+ #[cfg(any(feature = "flexbox", feature = "block_layout"))]
pub(crate) fn zip_size<R, F, U>(self, size: Size<U>, f: F) -> Rect<R>
where
F: Fn(T, U) -> R,