Refactor MSRV job to avoid it tripping dependabot (#541)
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 CARGO_REGISTRIES_CRATES_IO_PROTOCOL: "sparse"
14
15jobs:
16 # None
17 test-features-none:
18 name: "Test Suite [Features: None]"
19 runs-on: ubuntu-latest
20 steps:
21 - uses: actions/checkout@v4
22 - uses: dtolnay/rust-toolchain@stable
23 - run: cargo build --no-default-features
24 - run: cargo test --no-default-features --features taffy_tree
25
26 # MSRV check.
27 # Taffy only guarantees "latest stable". However we have this check here to ensure that we advertise
28 # our MSRV. We also make an effort not to increase MSRV in patch versions of Taffy.
29 test-features-msrv:
30 name: "Test Suite [Features: Default] (Rust 1.65)"
31 runs-on: ubuntu-latest
32 steps:
33 - uses: actions/checkout@v4
34 - uses: dtolnay/rust-toolchain@master
35 with:
36 toolchain: 1.65
37 - run: cargo build
38 - run: cargo test
39
40 # Default
41 test-features-default:
42 name: "Test Suite [Features: Default]"
43 runs-on: ubuntu-latest
44 steps:
45 - uses: actions/checkout@v4
46 - uses: dtolnay/rust-toolchain@stable
47 - run: cargo build
48 - run: cargo test
49
50 test-features-default-with-serde:
51 name: "Test Suite [Features: Default + serde]"
52 runs-on: ubuntu-latest
53 steps:
54 - uses: actions/checkout@v4
55 - uses: dtolnay/rust-toolchain@stable
56 - run: cargo build --features serde
57 - run: cargo test --features serde
58
59 test-features-no-grid-nor-flexbox:
60 name: "Test Suite [Features: std (no grid or flexbox)]"
61 runs-on: ubuntu-latest
62 steps:
63 - uses: actions/checkout@v4
64 - uses: dtolnay/rust-toolchain@stable
65 - run: cargo build --no-default-features --features std
66 - run: cargo build --no-default-features --features std,taffy_tree
67 - run: cargo test --no-default-features --features std,taffy_tree
68
69 # Flexbox
70 test-features-flexbox:
71 name: "Test Suite [Features: flexbox + std]"
72 runs-on: ubuntu-latest
73 steps:
74 - uses: actions/checkout@v4
75 - uses: dtolnay/rust-toolchain@stable
76 - run: cargo build --no-default-features --features flexbox,std
77 - run: cargo build --no-default-features --features flexbox,std,taffy_tree
78 - run: cargo test --no-default-features --features flexbox,std,taffy_tree
79
80 # Grid
81 test-features-grid:
82 name: "Test Suite [Features: grid + std]"
83 runs-on: ubuntu-latest
84 steps:
85 - uses: actions/checkout@v4
86 - uses: dtolnay/rust-toolchain@stable
87 - run: cargo build --no-default-features --features grid,std
88 - run: cargo build --no-default-features --features grid,std,taffy_tree
89 - run: cargo test --no-default-features --features grid,std,taffy_tree
90
91 test-features-grid-with-alloc:
92 name: "Test Suite [Features: grid + alloc]"
93 runs-on: ubuntu-latest
94 steps:
95 - uses: actions/checkout@v4
96 - uses: dtolnay/rust-toolchain@stable
97 - run: cargo build --no-default-features --features alloc,grid
98 - run: cargo build --no-default-features --features alloc,grid,taffy_tree
99 - run: cargo test --no-default-features --features alloc,grid,taffy_tree
100
101 test-features-alloc:
102 name: "Test Suite [Features: alloc]"
103 runs-on: ubuntu-latest
104 steps:
105 - uses: actions/checkout@v4
106 - uses: dtolnay/rust-toolchain@stable
107 - run: cargo build --no-default-features --features alloc
108 - run: cargo build --no-default-features --features alloc,taffy_tree
109 - run: cargo test --no-default-features --features alloc,taffy_tree
110
111 test-features-default-no-grid:
112 name: "Test Suite [Features: std (no grid)]"
113 runs-on: ubuntu-latest
114 steps:
115 - uses: actions/checkout@v4
116 - uses: dtolnay/rust-toolchain@stable
117 - run: cargo build --no-default-features --features std
118 - run: cargo build --no-default-features --features std,taffy_tree
119 - run: cargo test --no-default-features --features std,taffy_tree
120
121 fmt:
122 name: Rustfmt
123 runs-on: ubuntu-latest
124 steps:
125 - uses: actions/checkout@v4
126 - uses: dtolnay/rust-toolchain@master
127 with:
128 toolchain: stable
129 components: rustfmt
130 - run: cargo fmt --all -- --check
131
132 clippy:
133 name: Clippy
134 runs-on: ubuntu-latest
135 steps:
136 - uses: actions/checkout@v4
137 - uses: dtolnay/rust-toolchain@master
138 with:
139 toolchain: nightly
140 components: clippy
141 - run: cargo +nightly clippy --workspace -- -D warnings
142
143 doc:
144 name: Documentation
145 runs-on: ubuntu-latest
146 steps:
147 - uses: actions/checkout@v4
148 - uses: dtolnay/rust-toolchain@master
149 with:
150 toolchain: stable
151 components: clippy
152 - run: cargo doc
153
154 markdownlint:
155 name: Markdown Lint
156 runs-on: ubuntu-latest
157 steps:
158 - uses: actions/checkout@v4
159 - name: Run Markdown Lint
160 uses: DavidAnson/markdownlint-cli2-action@v13
161 with:
162 globs: '**/*.md'
163
164 fixture-format:
165 name: Test Fixture Formatting
166 runs-on: ubuntu-latest
167 steps:
168 - uses: actions/checkout@v4
169 - name: Run format script
170 run: cargo format-fixtures
171 - name: Ensure no changes
172 run: |
173 if [ -z "$(git status --porcelain)" ]; then
174 echo "Fixtures formatted correctly"
175 else
176 git status && echo -e "\nTest fixtures are not formatted correctly. Please run 'cargo format-fixtures'"
177 exit 1
178 fi
179
180 benchmarks:
181 name: Build Benchmarks
182 runs-on: ubuntu-latest
183 steps:
184 - uses: actions/checkout@v4
185 - uses: dtolnay/rust-toolchain@stable
186 - run: cargo xbench --no-run
187 name: Build benchmarks
188 env:
189 RUSTFLAGS: "-C opt-level=0"
190
191 benchmarks-with-yoga:
192 name: Build Benchmarks (w/ yoga)
193 runs-on: ubuntu-latest
194 steps:
195 - uses: actions/checkout@v4
196 - uses: dtolnay/rust-toolchain@stable
197 - run: cargo xbench --no-run --features yoga
198 name: Build benchmarks (w/yoga)
199 env:
200 RUSTFLAGS: "-C opt-level=0"