| 1 |
name: hybrid-array |
| 2 |
|
| 3 |
on: |
| 4 |
pull_request: |
| 5 |
paths-ignore: |
| 6 |
- README.md |
| 7 |
push: |
| 8 |
branches: master |
| 9 |
paths-ignore: |
| 10 |
- README.md |
| 11 |
|
| 12 |
permissions: |
| 13 |
contents: read |
| 14 |
|
| 15 |
env: |
| 16 |
CARGO_INCREMENTAL: 0 |
| 17 |
RUSTFLAGS: "-D warnings" |
| 18 |
RUSTDOCFLAGS: "-D warnings" |
| 19 |
|
| 20 |
jobs: |
| 21 |
build: |
| 22 |
runs-on: ubuntu-latest |
| 23 |
strategy: |
| 24 |
matrix: |
| 25 |
rust: |
| 26 |
- 1.85.0 # MSRV |
| 27 |
- stable |
| 28 |
target: |
| 29 |
- armv7a-none-eabi |
| 30 |
- thumbv7em-none-eabi |
| 31 |
- wasm32-unknown-unknown |
| 32 |
steps: |
| 33 |
- uses: actions/checkout@v7 |
| 34 |
- uses: RustCrypto/actions/cargo-cache@master |
| 35 |
- uses: dtolnay/rust-toolchain@master |
| 36 |
with: |
| 37 |
toolchain: ${{ matrix.rust }} |
| 38 |
targets: ${{ matrix.target }} |
| 39 |
- uses: RustCrypto/actions/cargo-hack-install@master |
| 40 |
- run: cargo hack build --target ${{ matrix.target }} --feature-powerset --exclude-all-features --optional-deps bytemuck,ctutils,serde,subtle,zeroize |
| 41 |
|
| 42 |
careful: |
| 43 |
runs-on: ubuntu-latest |
| 44 |
steps: |
| 45 |
- uses: actions/checkout@v7 |
| 46 |
- uses: dtolnay/rust-toolchain@nightly |
| 47 |
- run: cargo install cargo-careful |
| 48 |
- run: cargo careful test --all-features |
| 49 |
|
| 50 |
clippy: |
| 51 |
runs-on: ubuntu-latest |
| 52 |
steps: |
| 53 |
- uses: actions/checkout@v7 |
| 54 |
- uses: dtolnay/rust-toolchain@master |
| 55 |
with: |
| 56 |
toolchain: 1.94.0 |
| 57 |
components: clippy |
| 58 |
- run: cargo clippy --all-targets --all-features -- -D warnings |
| 59 |
|
| 60 |
# Generate code coverage and report to codecov.io |
| 61 |
coverage: |
| 62 |
runs-on: ubuntu-latest |
| 63 |
steps: |
| 64 |
- uses: actions/checkout@v7 |
| 65 |
- uses: dtolnay/rust-toolchain@stable |
| 66 |
with: |
| 67 |
components: llvm-tools |
| 68 |
- uses: taiki-e/install-action@cargo-llvm-cov |
| 69 |
- run: cargo llvm-cov --all-features --lcov --output-path lcov.info |
| 70 |
env: |
| 71 |
CARGO_HUSKY_DONT_INSTALL_HOOKS: true |
| 72 |
- uses: codecov/codecov-action@v7 |
| 73 |
with: |
| 74 |
fail_ci_if_error: true |
| 75 |
|
| 76 |
doc: |
| 77 |
runs-on: ubuntu-latest |
| 78 |
steps: |
| 79 |
- uses: actions/checkout@v7 |
| 80 |
- uses: dtolnay/rust-toolchain@master |
| 81 |
with: |
| 82 |
toolchain: stable |
| 83 |
- run: cargo doc --all-features |
| 84 |
|
| 85 |
miri: |
| 86 |
runs-on: ubuntu-latest |
| 87 |
env: |
| 88 |
MIRIFLAGS: "-Zmiri-symbolic-alignment-check -Zmiri-strict-provenance" |
| 89 |
strategy: |
| 90 |
matrix: |
| 91 |
target: |
| 92 |
- x86_64-unknown-linux-gnu |
| 93 |
- s390x-unknown-linux-gnu |
| 94 |
steps: |
| 95 |
- uses: actions/checkout@v7 |
| 96 |
- uses: dtolnay/rust-toolchain@nightly |
| 97 |
- run: rustup component add miri && cargo miri setup |
| 98 |
- run: cargo miri test --target ${{ matrix.target }} --all-features |
| 99 |
|
| 100 |
rustfmt: |
| 101 |
runs-on: ubuntu-latest |
| 102 |
steps: |
| 103 |
- uses: actions/checkout@v7 |
| 104 |
- uses: dtolnay/rust-toolchain@master |
| 105 |
with: |
| 106 |
toolchain: stable |
| 107 |
components: rustfmt |
| 108 |
- run: cargo fmt --all -- --check |
| 109 |
|
| 110 |
test: |
| 111 |
strategy: |
| 112 |
matrix: |
| 113 |
toolchain: |
| 114 |
- 1.85.0 # MSRV |
| 115 |
- stable |
| 116 |
runs-on: ubuntu-latest |
| 117 |
steps: |
| 118 |
- uses: actions/checkout@v7 |
| 119 |
- uses: RustCrypto/actions/cargo-cache@master |
| 120 |
- uses: dtolnay/rust-toolchain@master |
| 121 |
with: |
| 122 |
toolchain: ${{ matrix.toolchain }} |
| 123 |
- uses: RustCrypto/actions/cargo-hack-install@master |
| 124 |
- run: cargo hack test --feature-powerset --optional-deps arbitrary,bytemuck,serde,subtle,zeroize --group-features arbitrary,bytemuck,ctutils,serde,subtle,zeroize |
| 125 |
- run: cargo test --all-features --release |