|
1 | | -name: CI |
| 1 | +name: ci |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
|
7 | 7 | branches: [main] |
8 | 8 |
|
9 | 9 | env: |
| 10 | + WARNINGS_AS_ERRORS: yes |
10 | 11 | CARGO_TERM_COLOR: always |
11 | 12 |
|
12 | 13 | jobs: |
13 | | - build_and_test: |
| 14 | + slicec: |
| 15 | + strategy: |
| 16 | + fail-fast: false |
14 | 17 | runs-on: ubuntu-latest |
15 | 18 | timeout-minutes: 10 |
| 19 | + |
| 20 | + steps: |
| 21 | + - name: 📐 Setup |
| 22 | + run: rustup component add clippy |
| 23 | + - name: 📂 Checkout Repository |
| 24 | + uses: actions/checkout@v4 |
| 25 | + - name: 🔨 Build |
| 26 | + run: cargo build --all-targets -p slicec |
| 27 | + - name: 🧪 Test |
| 28 | + run: cargo test -p slicec |
| 29 | + - name: 🔎 Lint |
| 30 | + run: cargo clippy --all-targets --no-deps -p slicec |
| 31 | + - name: 📚 Generate Documentation |
| 32 | + run: cargo doc --document-private-items --no-deps -p slicec |
| 33 | + env: |
| 34 | + RUSTDOCFLAGS: "-D warnings" |
| 35 | + |
| 36 | + slice-codec: |
16 | 37 | strategy: |
17 | 38 | fail-fast: false |
18 | 39 | matrix: |
19 | | - features: |
20 | | - [ |
21 | | - "", |
22 | | - "alloc", |
23 | | - "std", |
24 | | - "tokio", |
25 | | - "std,tokio", |
26 | | - "slice2", |
27 | | - "slice2,alloc", |
28 | | - "slice2,std", |
29 | | - "slice2,tokio", |
30 | | - "slice2,std,tokio", |
31 | | - ] |
| 40 | + features: [ |
| 41 | + "", |
| 42 | + "alloc", |
| 43 | + "std", |
| 44 | + "tokio", |
| 45 | + "slice2", |
| 46 | + "slice2,alloc", |
| 47 | + "slice2,std", |
| 48 | + "slice2,tokio", |
| 49 | + ] |
| 50 | + runs-on: ubuntu-latest |
| 51 | + timeout-minutes: 10 |
| 52 | + |
32 | 53 | steps: |
33 | | - - name: 📦 Setup |
34 | | - run: echo "FEATURES=${{ matrix.features && '--features ' || '' }}${{ matrix.features }}" >> $GITHUB_ENV |
35 | | - - uses: actions/checkout@v4 |
36 | | - - name: 📦 Cache |
37 | | - uses: actions/cache@v3 |
38 | | - with: |
39 | | - path: | |
40 | | - ~/.cargo/bin/ |
41 | | - ~/.cargo/registry/index/ |
42 | | - ~/.cargo/registry/cache/ |
43 | | - ~/.cargo/git/db/ |
44 | | - target/ |
45 | | - Cargo.lock |
46 | | - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }} |
47 | | - restore-keys: | |
48 | | - ${{ runner.os }}-cargo- |
49 | | - - name: 📦 Install |
| 54 | + - name: 📐 Setup |
50 | 55 | run: | |
| 56 | + echo "FEATURES=${{ matrix.features && '--features ' || '' }}${{ matrix.features }}" >> $GITHUB_ENV |
51 | 57 | rustup toolchain install nightly |
52 | 58 | rustup component add clippy |
53 | 59 | rustup component add miri --toolchain nightly |
| 60 | + - name: 📂 Checkout Repository |
| 61 | + uses: actions/checkout@v4 |
54 | 62 | - name: 🔨 Build |
55 | | - run: cargo build --no-default-features $FEATURES |
| 63 | + run: cargo build --all-targets --no-default-features $FEATURES -p slice-codec |
56 | 64 | - name: 🧪 Test |
57 | | - run: cargo +nightly miri test --no-default-features $FEATURES |
58 | | - - name: 📚 Docs |
59 | | - run: cargo doc --no-deps --no-default-features --document-private-items $FEATURES |
| 65 | + run: cargo test --no-default-features $FEATURES -p slice-codec |
| 66 | + - name: 📋 Check Soundness |
| 67 | + run: cargo +nightly miri test --no-default-features $FEATURES -p slice-codec |
60 | 68 | - name: 🔎 Lint |
61 | | - run: cargo clippy --all-targets --no-default-features $FEATURES --no-deps |
| 69 | + run: cargo clippy --all-targets --no-default-features $FEATURES --no-deps -p slice-codec |
| 70 | + - name: 📚 Generate Documentation |
| 71 | + run: cargo doc --document-private-items --no-deps --no-default-features $FEATURES -p slice-codec |
| 72 | + env: |
| 73 | + RUSTDOCFLAGS: "-D warnings" |
62 | 74 |
|
63 | 75 | format: |
64 | 76 | runs-on: ubuntu-latest |
65 | 77 | timeout-minutes: 5 |
66 | 78 |
|
67 | 79 | steps: |
68 | | - - uses: actions/checkout@v3 |
69 | | - - name: 📦 Install nightly toolchain |
| 80 | + - name: 📂 Checkout Repository |
| 81 | + uses: actions/checkout@v4 |
| 82 | + - name: 📐 Setup |
70 | 83 | run: | |
71 | 84 | rustup toolchain install nightly |
72 | 85 | rustup component add rustfmt --toolchain nightly |
73 | | - - name: 🔎 Format using rustfmt |
| 86 | + - name: 🔎 Check Formatting |
74 | 87 | run: cargo +nightly fmt --check |
0 commit comments