|
9 | 9 | name: Continuous integration |
10 | 10 |
|
11 | 11 | jobs: |
12 | | - test-features-none: |
13 | | - name: "Test Suite [Features: None]" |
14 | | - runs-on: ubuntu-latest |
15 | | - steps: |
16 | | - - uses: actions/checkout@v3 |
17 | | - - uses: dtolnay/rust-toolchain@stable |
18 | | - - uses: Leafwing-Studios/cargo-cache@v1 |
19 | | - - run: cargo build --no-default-features |
20 | | - - run: cargo test --no-default-features |
21 | | - |
22 | 12 | test-features-default: |
23 | 13 | name: "Test Suite [Features: Default]" |
24 | 14 | runs-on: ubuntu-latest |
25 | 15 | steps: |
26 | 16 | - uses: actions/checkout@v3 |
27 | 17 | - uses: dtolnay/rust-toolchain@stable |
28 | | - - run: cargo build |
29 | | - - run: cargo test |
30 | | - |
31 | | - test-features-default-with-serde: |
32 | | - name: "Test Suite [Features: Default + serde]" |
33 | | - runs-on: ubuntu-latest |
34 | | - steps: |
35 | | - - uses: actions/checkout@v3 |
36 | | - - uses: dtolnay/rust-toolchain@stable |
37 | | - - run: cargo build --features serde |
38 | | - - run: cargo test --features serde |
39 | | - |
40 | | - test-features-alloc: |
41 | | - name: "Test Suite [Features: alloc]" |
42 | | - runs-on: ubuntu-latest |
43 | | - steps: |
44 | | - - uses: actions/checkout@v3 |
45 | | - - uses: dtolnay/rust-toolchain@stable |
46 | | - - run: cargo build --no-default-features --features alloc,grid |
47 | | - - run: cargo test --no-default-features --features alloc,grid |
48 | | - |
49 | | - test-features-alloc-no-grid: |
50 | | - name: "Test Suite [Features: alloc (no grid)]" |
| 18 | + - uses: Leafwing-Studios/cargo-cache@v1 |
| 19 | + - run: | |
| 20 | + cargo build |
| 21 | + cargo test |
| 22 | + |
| 23 | + # This tests all enabled default features with each of the optional features on top. |
| 24 | + test-features-with-default: |
51 | 25 | runs-on: ubuntu-latest |
| 26 | + strategy: |
| 27 | + matrix: |
| 28 | + feature: [serde, random, alloc] |
52 | 29 | steps: |
53 | 30 | - uses: actions/checkout@v3 |
54 | 31 | - uses: dtolnay/rust-toolchain@stable |
55 | | - - run: cargo build --no-default-features --features alloc |
56 | | - - run: cargo test --no-default-features --features alloc |
57 | | - |
58 | | - test-features-default-no-grid: |
59 | | - name: "Test Suite [Features: std (no grid)]" |
| 32 | + - uses: Leafwing-Studios/cargo-cache@v1 |
| 33 | + - run: | |
| 34 | + cargo build --features ${{ matrix.feature }} |
| 35 | + cargo test --features ${{ matrix.feature }} |
| 36 | + |
| 37 | + # This test all layout features with each of the optional features in isolation. |
| 38 | + test-features-without-default: |
60 | 39 | runs-on: ubuntu-latest |
| 40 | + strategy: |
| 41 | + matrix: |
| 42 | + layout: [flexbox, grid, none] |
| 43 | + feature: [std, alloc, serde, none] |
61 | 44 | steps: |
62 | 45 | - uses: actions/checkout@v3 |
63 | 46 | - uses: dtolnay/rust-toolchain@stable |
64 | 47 | - uses: Leafwing-Studios/cargo-cache@v1 |
65 | | - - run: cargo build --no-default-features --features std |
66 | | - - run: cargo test --no-default-features --features std |
| 48 | + - if: ${{ matrix.layout == 'none' && matrix.feature == 'none' }} |
| 49 | + run: | |
| 50 | + cargo build --no-default-features |
| 51 | + cargo test --no-default-features |
| 52 | + - if: ${{ matrix.layout != 'none' && matrix.feature == 'none' }} |
| 53 | + run: | |
| 54 | + cargo build --no-default-features --features ${{ matrix.layout }} |
| 55 | + cargo test --no-default-features --features ${{ matrix.layout }} |
| 56 | + - if: ${{ matrix.layout == 'none' && matrix.feature != 'none' }} |
| 57 | + run: | |
| 58 | + cargo build --no-default-features --features ${{ matrix.feature }} |
| 59 | + cargo test --no-default-features --features ${{ matrix.feature }} |
| 60 | + - if: ${{ matrix.layout != 'none' && matrix.feature != 'none' }} |
| 61 | + run: | |
| 62 | + cargo build --no-default-features --features ${{ matrix.layout }},${{ matrix.feature }} |
| 63 | + cargo test --no-default-features --features ${{ matrix.layout }},${{ matrix.feature }} |
67 | 64 |
|
68 | 65 | fmt: |
69 | 66 | name: Rustfmt |
|
0 commit comments