| 1 |
name: CI |
| 2 |
on: [push, pull_request] |
| 3 |
|
| 4 |
|
| 5 |
permissions: |
| 6 |
contents: read |
| 7 |
|
| 8 |
jobs: |
| 9 |
test: |
| 10 |
name: Test |
| 11 |
runs-on: ${{ matrix.os }} |
| 12 |
strategy: |
| 13 |
matrix: |
| 14 |
include: |
| 15 |
- build: stable |
| 16 |
os: ubuntu-latest |
| 17 |
rust: stable |
| 18 |
- build: beta |
| 19 |
os: ubuntu-latest |
| 20 |
rust: beta |
| 21 |
- build: nightly |
| 22 |
os: ubuntu-latest |
| 23 |
rust: nightly |
| 24 |
- build: macos |
| 25 |
os: macos-latest |
| 26 |
rust: stable |
| 27 |
- build: win32 |
| 28 |
os: windows-latest |
| 29 |
rust: stable-i686-pc-windows-msvc |
| 30 |
- build: win64 |
| 31 |
os: windows-latest |
| 32 |
rust: stable-x86_64-pc-windows-msvc |
| 33 |
- build: mingw |
| 34 |
os: windows-latest |
| 35 |
rust: stable-x86_64-pc-windows-gnu |
| 36 |
steps: |
| 37 |
- uses: actions/checkout@v4 |
| 38 |
- uses: dtolnay/rust-toolchain@master |
| 39 |
with: |
| 40 |
toolchain: ${{ matrix.rust }} |
| 41 |
- uses: taiki-e/install-action@cargo-hack |
| 42 |
- run: cargo hack test --feature-powerset --exclude-features max_level_off,max_level_error,max_level_warn,max_level_info,max_level_debug,max_level_trace,release_max_level_off,release_max_level_error,release_max_level_warn,release_max_level_info,release_max_level_debug,release_max_level_trace |
| 43 |
- run: cargo run --verbose --manifest-path test_max_level_features/Cargo.toml |
| 44 |
- run: cargo run --verbose --manifest-path test_max_level_features/Cargo.toml --release |
| 45 |
|
| 46 |
check: |
| 47 |
name: Check Format and Clippy |
| 48 |
runs-on: ubuntu-latest |
| 49 |
steps: |
| 50 |
- uses: actions/checkout@v4 |
| 51 |
- uses: dtolnay/rust-toolchain@stable |
| 52 |
with: |
| 53 |
components: clippy |
| 54 |
- run: cargo fmt -- --check |
| 55 |
- run: cargo fmt --manifest-path test_max_level_features/Cargo.toml -- --check |
| 56 |
- run: cargo clippy --verbose |
| 57 |
- run: cargo clippy --verbose --manifest-path test_max_level_features/Cargo.toml |
| 58 |
|
| 59 |
doc: |
| 60 |
name: Check Documentation |
| 61 |
runs-on: ubuntu-latest |
| 62 |
steps: |
| 63 |
- uses: actions/checkout@v4 |
| 64 |
- uses: dtolnay/rust-toolchain@stable |
| 65 |
- name: Run rustdoc |
| 66 |
env: |
| 67 |
RUSTDOCFLAGS: "-D warnings" |
| 68 |
run: cargo doc --verbose --features std,kv,kv_std,kv_sval,kv_serde |
| 69 |
|
| 70 |
features: |
| 71 |
name: Feature check |
| 72 |
runs-on: ubuntu-latest |
| 73 |
steps: |
| 74 |
- uses: actions/checkout@v4 |
| 75 |
- uses: dtolnay/rust-toolchain@nightly |
| 76 |
- run: cargo build --verbose -Z avoid-dev-deps --features kv |
| 77 |
- run: cargo build --verbose -Z avoid-dev-deps --features "kv std" |
| 78 |
- run: cargo build --verbose -Z avoid-dev-deps --features "kv kv_sval" |
| 79 |
- run: cargo build --verbose -Z avoid-dev-deps --features "kv kv_serde" |
| 80 |
- run: cargo build --verbose -Z avoid-dev-deps --features "kv kv_std" |
| 81 |
- run: cargo build --verbose -Z avoid-dev-deps --features "kv kv_sval kv_serde" |
| 82 |
|
| 83 |
minimalv: |
| 84 |
name: Minimal versions |
| 85 |
runs-on: ubuntu-latest |
| 86 |
steps: |
| 87 |
- uses: actions/checkout@v4 |
| 88 |
- uses: dtolnay/rust-toolchain@nightly |
| 89 |
- run: cargo build --verbose -Z minimal-versions --features kv |
| 90 |
- run: cargo build --verbose -Z minimal-versions --features "kv std" |
| 91 |
- run: cargo build --verbose -Z minimal-versions --features "kv kv_sval" |
| 92 |
- run: cargo build --verbose -Z minimal-versions --features "kv kv_serde" |
| 93 |
- run: cargo build --verbose -Z minimal-versions --features "kv kv_std" |
| 94 |
- run: cargo build --verbose -Z minimal-versions --features "kv kv_sval kv_serde" |
| 95 |
|
| 96 |
msrv: |
| 97 |
name: MSRV |
| 98 |
runs-on: ubuntu-latest |
| 99 |
steps: |
| 100 |
- uses: actions/checkout@v4 |
| 101 |
- uses: dtolnay/[email protected] |
| 102 |
with: |
| 103 |
components: clippy |
| 104 |
- uses: taiki-e/install-action@cargo-hack |
| 105 |
- run: cargo hack test --feature-powerset --exclude-features max_level_off,max_level_error,max_level_warn,max_level_info,max_level_debug,max_level_trace,release_max_level_off,release_max_level_error,release_max_level_warn,release_max_level_info,release_max_level_debug,release_max_level_trace |
| 106 |
- run: cargo run --verbose --manifest-path test_max_level_features/Cargo.toml |
| 107 |
- run: cargo run --verbose --manifest-path test_max_level_features/Cargo.toml --release |
| 108 |
|
| 109 |
embedded: |
| 110 |
name: Embedded |
| 111 |
runs-on: ubuntu-latest |
| 112 |
steps: |
| 113 |
- uses: actions/checkout@v4 |
| 114 |
- uses: dtolnay/rust-toolchain@stable |
| 115 |
- run: rustup target add thumbv6m-none-eabi riscv32imc-unknown-none-elf |
| 116 |
- run: cargo build --verbose --target=thumbv6m-none-eabi |
| 117 |
- run: cargo build --verbose --target=riscv32imc-unknown-none-elf |