| 1 |
name: CI |
| 2 |
on: [push, pull_request] |
| 3 |
|
| 4 |
permissions: |
| 5 |
contents: read # to fetch code (actions/checkout) |
| 6 |
|
| 7 |
jobs: |
| 8 |
test: |
| 9 |
name: Test |
| 10 |
runs-on: ${{ matrix.os }} |
| 11 |
strategy: |
| 12 |
matrix: |
| 13 |
build: [stable, beta, nightly, macos, win32, win64, mingw] |
| 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@master |
| 38 |
- name: Install Rust |
| 39 |
run: | |
| 40 |
rustup update ${{ matrix.rust }} --no-self-update |
| 41 |
rustup default ${{ matrix.rust }} |
| 42 |
- run: cargo test --verbose |
| 43 |
- run: cargo test --verbose --no-default-features |
| 44 |
- run: cargo test --verbose --all-features |
| 45 |
- run: cargo test --verbose --features serde |
| 46 |
- run: cargo test --verbose --features std |
| 47 |
- run: cargo test --verbose --features kv |
| 48 |
- run: cargo test --verbose --features kv_sval |
| 49 |
- run: cargo test --verbose --features kv_serde |
| 50 |
- run: cargo test --verbose --features "kv kv_std kv_sval kv_serde" |
| 51 |
- run: cargo run --verbose --manifest-path test_max_level_features/Cargo.toml |
| 52 |
- run: cargo run --verbose --manifest-path test_max_level_features/Cargo.toml --release |
| 53 |
|
| 54 |
rustfmt: |
| 55 |
name: Rustfmt |
| 56 |
runs-on: ubuntu-latest |
| 57 |
steps: |
| 58 |
- uses: actions/checkout@master |
| 59 |
- name: Install Rust |
| 60 |
run: | |
| 61 |
rustup update stable --no-self-update |
| 62 |
rustup default stable |
| 63 |
rustup component add rustfmt |
| 64 |
# log repo does not use Cargo workspaces, so `cargo fmt` will not check all the code |
| 65 |
# perhaps this should be changed in the future |
| 66 |
- run: cargo fmt -- --check |
| 67 |
- run: cargo fmt --manifest-path test_max_level_features/Cargo.toml -- --check |
| 68 |
- run: cargo fmt --manifest-path tests/Cargo.toml -- --check |
| 69 |
|
| 70 |
clippy: |
| 71 |
name: Clippy |
| 72 |
runs-on: ubuntu-latest |
| 73 |
steps: |
| 74 |
- uses: actions/checkout@master |
| 75 |
- name: Install Rust |
| 76 |
run: | |
| 77 |
rustup update stable --no-self-update |
| 78 |
rustup default stable |
| 79 |
rustup component add clippy |
| 80 |
- run: cargo clippy --verbose |
| 81 |
- run: cargo clippy --verbose --manifest-path test_max_level_features/Cargo.toml |
| 82 |
- run: cargo clippy --verbose --manifest-path tests/Cargo.toml |
| 83 |
|
| 84 |
doc: |
| 85 |
name: Check Documentation |
| 86 |
runs-on: ubuntu-latest |
| 87 |
steps: |
| 88 |
- uses: actions/checkout@master |
| 89 |
- name: Install Rust |
| 90 |
run: | |
| 91 |
rustup update stable --no-self-update |
| 92 |
rustup default stable |
| 93 |
rustup component add rust-docs |
| 94 |
- name: Run rustdoc |
| 95 |
run: RUSTDOCFLAGS="-D warnings" cargo doc --verbose --all-features |
| 96 |
|
| 97 |
features: |
| 98 |
name: Feature check |
| 99 |
runs-on: ubuntu-latest |
| 100 |
steps: |
| 101 |
- uses: actions/checkout@master |
| 102 |
- name: Install Rust |
| 103 |
run: | |
| 104 |
rustup update nightly --no-self-update |
| 105 |
rustup default nightly |
| 106 |
- run: cargo build --verbose -Z avoid-dev-deps --features kv |
| 107 |
- run: cargo build --verbose -Z avoid-dev-deps --features "kv std" |
| 108 |
- run: cargo build --verbose -Z avoid-dev-deps --features "kv kv_sval" |
| 109 |
- run: cargo build --verbose -Z avoid-dev-deps --features "kv kv_serde" |
| 110 |
- run: cargo build --verbose -Z avoid-dev-deps --features "kv kv_std" |
| 111 |
- run: cargo build --verbose -Z avoid-dev-deps --features "kv kv_sval kv_serde" |
| 112 |
|
| 113 |
minimalv: |
| 114 |
name: Minimal versions |
| 115 |
runs-on: ubuntu-latest |
| 116 |
steps: |
| 117 |
- uses: actions/checkout@master |
| 118 |
- name: Install Rust |
| 119 |
run: | |
| 120 |
rustup update nightly --no-self-update |
| 121 |
rustup default nightly |
| 122 |
- run: cargo build --verbose -Z minimal-versions --features kv |
| 123 |
- run: cargo build --verbose -Z minimal-versions --features "kv std" |
| 124 |
- run: cargo build --verbose -Z minimal-versions --features "kv kv_sval" |
| 125 |
- run: cargo build --verbose -Z minimal-versions --features "kv kv_serde" |
| 126 |
- run: cargo build --verbose -Z minimal-versions --features "kv kv_std" |
| 127 |
- run: cargo build --verbose -Z minimal-versions --features "kv kv_sval kv_serde" |
| 128 |
|
| 129 |
msrv: |
| 130 |
name: MSRV |
| 131 |
runs-on: ubuntu-latest |
| 132 |
steps: |
| 133 |
- uses: actions/checkout@master |
| 134 |
- name: Install Rust |
| 135 |
run: | |
| 136 |
rustup update 1.60.0 --no-self-update |
| 137 |
rustup default 1.60.0 |
| 138 |
- run: | |
| 139 |
cargo test --verbose --manifest-path tests/Cargo.toml |
| 140 |
cargo test --verbose --manifest-path tests/Cargo.toml --features kv |
| 141 |
|
| 142 |
embedded: |
| 143 |
name: Embedded |
| 144 |
runs-on: ubuntu-latest |
| 145 |
steps: |
| 146 |
- uses: actions/checkout@master |
| 147 |
- name: Install Rust |
| 148 |
run: | |
| 149 |
rustup update stable --no-self-update |
| 150 |
rustup default stable |
| 151 |
- run: rustup target add thumbv6m-none-eabi riscv32imc-unknown-none-elf |
| 152 |
- run: cargo build --verbose --target=thumbv6m-none-eabi |
| 153 |
- run: cargo build --verbose --target=riscv32imc-unknown-none-elf |