From 88a9263d5cede4284224d353c85bf455e6bb800c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 10 Apr 2025 22:57:55 +0200 Subject: [PATCH] prep first release --- .github/workflows/ci.yml | 72 ++++++++++++++++++++++++++++++++++++++++ README.md | 6 +++- 2 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..dec7e0b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,72 @@ +name: ci +on: [push, pull_request] + +jobs: + check: + name: Check build + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - run: cargo check --release + + test: + name: Run Tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - name: Install nextest + uses: taiki-e/install-action@nextest + - run: cargo nextest run --all-features + - run: cargo test --doc + + msrv: + name: Check MSRV + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@1.81.0 + - run: cargo check --release + + cross-check: + name: Check Cross-Compilation + runs-on: ubuntu-latest + strategy: + matrix: + target: + - armv7-unknown-linux-gnueabihf + - thumbv7em-none-eabihf + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + targets: "armv7-unknown-linux-gnueabihf, thumbv7em-none-eabihf" + - run: cargo check --release --target=${{matrix.target}} --no-default-features + + fmt: + name: Check formatting + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - run: cargo fmt --all -- --check + + docs: + name: Check Documentation Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@nightly + - run: RUSTDOCFLAGS="--cfg docsrs --generate-link-to-definition -Z unstable-options" cargo +nightly doc --all-features + + clippy: + name: Clippy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - run: cargo clippy -- -D warnings diff --git a/README.md b/README.md index e08fc90..04cc317 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,8 @@ -`raw-slice`: Generic raw slice types +[![Crates.io](https://img.shields.io/crates/v/raw-slice)](https://crates.io/crates/raw-slice) +[![docs.rs](https://img.shields.io/docsrs/raw-slice)](https://docs.rs/raw-slice) +[![ci](https://github.com/us-irs/raw-slice/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/us-irs/raw-slice/actions/workflows/ci.yml) + +`raw-slice` - Generic raw slice types ====== This crate provides generic raw slice type, which allows erasing the lifetime of a borrowed slice.