Move benchmarks into their own crate (#451)
1on:
2 pull_request:
3 push:
4 branches:
5 - main
6 - 0.2.x
7 - 0.3.x
8
9name: Continuous integration
10
11env:
12 RUSTDOCFLAGS: "-D warnings"
13
14jobs:
15 # None
16 test-features-none:
17 name: "Test Suite [Features: None]"
18 runs-on: ubuntu-latest
19 steps:
20 - uses: actions/checkout@v3
21 - uses: dtolnay/rust-toolchain@stable
22 - uses: Leafwing-Studios/cargo-cache@v1
23 - run: cargo build --no-default-features
24 - run: cargo test --no-default-features --features taffy_tree
25
26 # Default
27 test-features-default:
28 name: "Test Suite [Features: Default]"
29 runs-on: ubuntu-latest
30 steps:
31 - uses: actions/checkout@v3
32 - uses: dtolnay/rust-toolchain@stable
33 - run: cargo build
34 - run: cargo test
35
36 test-features-default-with-serde:
37 name: "Test Suite [Features: Default + serde]"
38 runs-on: ubuntu-latest
39 steps:
40 - uses: actions/checkout@v3
41 - uses: dtolnay/rust-toolchain@stable
42 - run: cargo build --features serde
43 - run: cargo test --features serde
44
45 test-features-no-grid-nor-flexbox:
46 name: "Test Suite [Features: std (no grid or flexbox)]"
47 runs-on: ubuntu-latest
48 steps:
49 - uses: actions/checkout@v3
50 - uses: dtolnay/rust-toolchain@stable
51 - run: cargo build --no-default-features --features std
52 - run: cargo build --no-default-features --features std,taffy_tree
53 - run: cargo test --no-default-features --features std,taffy_tree
54
55 # Flexbox
56 test-features-flexbox:
57 name: "Test Suite [Features: flexbox + std]"
58 runs-on: ubuntu-latest
59 steps:
60 - uses: actions/checkout@v3
61 - uses: dtolnay/rust-toolchain@stable
62 - run: cargo build --no-default-features --features flexbox,std
63 - run: cargo build --no-default-features --features flexbox,std,taffy_tree
64 - run: cargo test --no-default-features --features flexbox,std,taffy_tree
65
66 # Grid
67 test-features-grid:
68 name: "Test Suite [Features: grid + std]"
69 runs-on: ubuntu-latest
70 steps:
71 - uses: actions/checkout@v3
72 - uses: dtolnay/rust-toolchain@stable
73 - run: cargo build --no-default-features --features grid,std
74 - run: cargo build --no-default-features --features grid,std,taffy_tree
75 - run: cargo test --no-default-features --features grid,std,taffy_tree
76
77 test-features-grid-with-alloc:
78 name: "Test Suite [Features: grid + alloc]"
79 runs-on: ubuntu-latest
80 steps:
81 - uses: actions/checkout@v3
82 - uses: dtolnay/rust-toolchain@stable
83 - run: cargo build --no-default-features --features alloc,grid
84 - run: cargo build --no-default-features --features alloc,grid,taffy_tree
85 - run: cargo test --no-default-features --features alloc,grid,taffy_tree
86
87 test-features-alloc:
88 name: "Test Suite [Features: alloc]"
89 runs-on: ubuntu-latest
90 steps:
91 - uses: actions/checkout@v3
92 - uses: dtolnay/rust-toolchain@stable
93 - run: cargo build --no-default-features --features alloc
94 - run: cargo build --no-default-features --features alloc,taffy_tree
95 - run: cargo test --no-default-features --features alloc,taffy_tree
96
97 test-features-default-no-grid:
98 name: "Test Suite [Features: std (no grid)]"
99 runs-on: ubuntu-latest
100 steps:
101 - uses: actions/checkout@v3
102 - uses: dtolnay/rust-toolchain@stable
103 - uses: Leafwing-Studios/cargo-cache@v1
104 - run: cargo build --no-default-features --features std
105 - run: cargo build --no-default-features --features std,taffy_tree
106 - run: cargo test --no-default-features --features std,taffy_tree
107
108 fmt:
109 name: Rustfmt
110 runs-on: ubuntu-latest
111 steps:
112 - uses: actions/checkout@v3
113 - uses: dtolnay/rust-toolchain@master
114 with:
115 toolchain: stable
116 components: rustfmt
117 - uses: Leafwing-Studios/cargo-cache@v1
118 - run: cargo fmt --all -- --check
119
120 clippy:
121 name: Clippy
122 runs-on: ubuntu-latest
123 steps:
124 - uses: actions/checkout@v3
125 - uses: dtolnay/rust-toolchain@master
126 with:
127 toolchain: nightly
128 components: clippy
129 - uses: Leafwing-Studios/cargo-cache@v1
130 - run: cargo +nightly clippy --workspace -- -D warnings
131
132 doc:
133 name: Documentation
134 runs-on: ubuntu-latest
135 steps:
136 - uses: actions/checkout@v3
137 - uses: dtolnay/rust-toolchain@master
138 with:
139 toolchain: stable
140 components: clippy
141 - uses: Leafwing-Studios/cargo-cache@v1
142 - run: cargo doc
143
144 benchmarks:
145 name: Build Benchmarks
146 runs-on: ubuntu-latest
147 steps:
148 - uses: actions/checkout@v3
149 - uses: dtolnay/rust-toolchain@master
150 with:
151 toolchain: stable
152 components: clippy
153 - uses: Leafwing-Studios/cargo-cache@v1
154 - run: cargo xbench --no-run
155 name: Build benchmarks
156 - run: cargo xbench --no-run --features yoga
157 name: Build benchmarks (w/yoga)
158
159 markdownlint:
160 name: Markdown Lint
161 runs-on: ubuntu-latest
162 steps:
163 - uses: actions/checkout@v3
164 with:
165 # Full git history is needed to get a proper list of changed files within `super-linter`
166 fetch-depth: 0
167 - name: Run Markdown Lint
168 uses: docker://ghcr.io/github/super-linter:slim-v4
169 env:
170 VALIDATE_ALL_CODEBASE: true
171 VALIDATE_MARKDOWN: true
172 DEFAULT_BRANCH: master