Skip to content

Commit

Permalink
Build examples separately in CI (#727)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoburns authored Oct 22, 2024
1 parent 73cf7fc commit 343203d
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,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:
build-features-msrv:
name: "MSRV Build [Rust 1.65]"
runs-on: ubuntu-latest
steps:
Expand All @@ -29,14 +29,22 @@ jobs:
toolchain: 1.65
- run: cargo build

test-features-debug:
build-features-debug:
name: "Build [debug feature]"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --features debug

build-examples:
name: "Build Examples"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --examples

# No features
test-features-none:
name: "Test Suite [no features]"
Expand All @@ -45,7 +53,7 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --no-default-features
- run: cargo test --no-default-features --features taffy_tree
- run: cargo test --tests --no-default-features --features taffy_tree

# Default
test-features-default:
Expand All @@ -55,7 +63,7 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo build
- run: cargo test
- run: cargo test --tests

test-features-default-with-serde:
name: "Test Suite [default + serde]"
Expand All @@ -64,7 +72,7 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --features serde
- run: cargo test --features serde
- run: cargo test --tests --features serde

test-features-default-except-content-size:
name: "Test Suite [default except content_size]"
Expand All @@ -73,7 +81,7 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --no-default-features --features std,taffy_tree,grid,flexbox,block_layout
- run: cargo test --no-default-features --features std,taffy_tree,grid,flexbox,block_layout
- run: cargo test --tests --no-default-features --features std,taffy_tree,grid,flexbox,block_layout

test-features-no-grid-nor-flexbox:
name: "Test Suite [std (no algorithms)]"
Expand All @@ -83,7 +91,7 @@ jobs:
- 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 test --tests --no-default-features --features std,taffy_tree

# With std feature
test-features-flexbox:
Expand All @@ -94,7 +102,7 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --no-default-features --features flexbox,std
- run: cargo build --no-default-features --features flexbox,std,taffy_tree
- run: cargo test --no-default-features --features flexbox,std,taffy_tree
- run: cargo test --tests --no-default-features --features flexbox,std,taffy_tree

test-features-grid:
name: "Test Suite [std + grid]"
Expand All @@ -104,7 +112,7 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --no-default-features --features grid,std
- run: cargo build --no-default-features --features grid,std,taffy_tree
- run: cargo test --no-default-features --features grid,std,taffy_tree
- run: cargo test --tests --no-default-features --features grid,std,taffy_tree

test-features-block:
name: "Test Suite [std + block)]"
Expand All @@ -114,7 +122,7 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
- 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
- run: cargo test --tests --no-default-features --features block_layout,std,taffy_tree

# With alloc feature

Expand All @@ -126,7 +134,7 @@ jobs:
- 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 --tests --no-default-features --features alloc,taffy_tree

test-features-alloc:
name: "Test Suite [alloc + all algorithms]"
Expand All @@ -136,7 +144,7 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
- 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
- run: cargo test --tests --no-default-features --features alloc,grid,flexbox,block_layout,taffy_tree

fmt:
name: Rustfmt
Expand Down

0 comments on commit 343203d

Please sign in to comment.