tawasuyu

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 501HTML 254C 19JavaScript 81414 Sutichaykuna

⎇ d04d9702acd00a9828e8fec0598750edc649aeb1 .github/workflows/ci.yml YAML · 209 siq'ikuna · 6.4 KB Ñawpa willay ch'uya

Bump DavidAnson/markdownlint-cli2-action from 14 to 15 (#603) d04d9702a · dependabot[bot] ·

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-default-except-content-size:
60    name: "Test Suite [Features: Default except content_size]"
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,taffy_tree,grid,flexbox,block_layout
66      - run: cargo test --no-default-features --features std,taffy_tree,grid,flexbox,block_layout
67
68  test-features-no-grid-nor-flexbox:
69    name: "Test Suite [Features: std (no grid or flexbox)]"
70    runs-on: ubuntu-latest
71    steps:
72      - uses: actions/checkout@v4
73      - uses: dtolnay/rust-toolchain@stable
74      - run: cargo build --no-default-features --features std
75      - run: cargo build --no-default-features --features std,taffy_tree
76      - run: cargo test --no-default-features --features std,taffy_tree
77
78  # Flexbox
79  test-features-flexbox:
80    name: "Test Suite [Features: flexbox + std]"
81    runs-on: ubuntu-latest
82    steps:
83      - uses: actions/checkout@v4
84      - uses: dtolnay/rust-toolchain@stable
85      - run: cargo build --no-default-features --features flexbox,std
86      - run: cargo build --no-default-features --features flexbox,std,taffy_tree
87      - run: cargo test --no-default-features --features flexbox,std,taffy_tree
88
89  # Grid
90  test-features-grid:
91    name: "Test Suite [Features: grid + std]"
92    runs-on: ubuntu-latest
93    steps:
94      - uses: actions/checkout@v4
95      - uses: dtolnay/rust-toolchain@stable
96      - run: cargo build --no-default-features --features grid,std
97      - run: cargo build --no-default-features --features grid,std,taffy_tree
98      - run: cargo test --no-default-features --features grid,std,taffy_tree
99
100  test-features-grid-with-alloc:
101    name: "Test Suite [Features: grid + alloc]"
102    runs-on: ubuntu-latest
103    steps:
104      - uses: actions/checkout@v4
105      - uses: dtolnay/rust-toolchain@stable
106      - run: cargo build --no-default-features --features alloc,grid
107      - run: cargo build --no-default-features --features alloc,grid,taffy_tree
108      - run: cargo test --no-default-features --features alloc,grid,taffy_tree
109
110  test-features-alloc:
111    name: "Test Suite [Features: alloc]"
112    runs-on: ubuntu-latest
113    steps:
114      - uses: actions/checkout@v4
115      - uses: dtolnay/rust-toolchain@stable
116      - run: cargo build --no-default-features --features alloc
117      - run: cargo build --no-default-features --features alloc,taffy_tree
118      - run: cargo test  --no-default-features --features alloc,taffy_tree
119
120  test-features-default-no-grid:
121    name: "Test Suite [Features: std (no grid)]"
122    runs-on: ubuntu-latest
123    steps:
124      - uses: actions/checkout@v4
125      - uses: dtolnay/rust-toolchain@stable
126      - run: cargo build --no-default-features --features std
127      - run: cargo build --no-default-features --features std,taffy_tree
128      - run: cargo test --no-default-features --features std,taffy_tree
129
130  fmt:
131    name: Rustfmt
132    runs-on: ubuntu-latest
133    steps:
134      - uses: actions/checkout@v4
135      - uses: dtolnay/rust-toolchain@master
136        with:
137          toolchain: stable
138          components: rustfmt
139      - run: cargo fmt --all -- --check
140
141  clippy:
142    name: Clippy
143    runs-on: ubuntu-latest
144    steps:
145      - uses: actions/checkout@v4
146      - uses: dtolnay/rust-toolchain@master
147        with:
148          toolchain: nightly
149          components: clippy
150      - run: cargo +nightly clippy --workspace -- -D warnings
151
152  doc:
153    name: Documentation
154    runs-on: ubuntu-latest
155    steps:
156      - uses: actions/checkout@v4
157      - uses: dtolnay/rust-toolchain@master
158        with:
159          toolchain: stable
160          components: clippy
161      - run: cargo doc
162
163  markdownlint:
164    name: Markdown Lint
165    runs-on: ubuntu-latest
166    steps:
167      - uses: actions/checkout@v4
168      - name: Run Markdown Lint
169        uses: DavidAnson/markdownlint-cli2-action@v15
170        with:
171          globs: '**/*.md'
172
173  fixture-format:
174    name: Test Fixture Formatting
175    runs-on: ubuntu-latest
176    steps:
177      - uses: actions/checkout@v4
178      - name: Run format script
179        run: cargo format-fixtures
180      - name: Ensure no changes
181        run: |
182          if [ -z "$(git status --porcelain)" ]; then 
183            echo "Fixtures formatted correctly"
184          else 
185            git status && echo -e "\nTest fixtures are not formatted correctly. Please run 'cargo format-fixtures'"
186            exit 1
187          fi
188
189  benchmarks:
190    name: Build Benchmarks
191    runs-on: ubuntu-latest
192    steps:
193      - uses: actions/checkout@v4
194      - uses: dtolnay/rust-toolchain@stable
195      - run: cargo xbench --no-run
196        name: Build benchmarks
197        env:
198          RUSTFLAGS: "-C opt-level=0" 
199
200  benchmarks-with-yoga:
201    name: Build Benchmarks (w/ yoga)
202    runs-on: ubuntu-latest
203    steps:
204      - uses: actions/checkout@v4
205      - uses: dtolnay/rust-toolchain@stable
206      - run: cargo xbench --no-run --features yoga
207        name: Build benchmarks (w/yoga)
208        env:
209            RUSTFLAGS: "-C opt-level=0"