New public API (v4.0.0) #121
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- master | |
tags: | |
- 'v*' | |
pull_request: | |
name: CI | |
jobs: | |
build: | |
name: Cargo Build | |
runs-on: ubuntu-latest | |
env: {"RUSTFLAGS": "-D warnings"} | |
strategy: | |
matrix: | |
target: | |
- "x86_64-unknown-linux-gnu" | |
- "thumbv6m-none-eabi" | |
- "thumbv7em-none-eabi" | |
toolchain: | |
- "nightly" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
target: ${{ matrix.target }} | |
- run: cargo build --target ${{ matrix.target }} | |
test: | |
name: Unit Tests | |
runs-on: ubuntu-latest | |
env: {"RUSTFLAGS": "-D warnings"} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@nightly | |
- run: cargo test | |
clippy: | |
name: Clippy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@nightly | |
with: | |
components: clippy | |
- run: cargo clippy -- -Dclippy::all -Dclippy::pedantic --deny warnings | |
format: | |
name: Format | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@nightly | |
with: | |
components: rustfmt | |
- run: cargo +nightly fmt -- --check | |
doc: | |
name: doc | |
runs-on: ubuntu-latest | |
env: {"RUSTDOCFLAGS": "-D warnings --cfg docsrs"} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@nightly | |
- run: cargo +nightly rustdoc | |
examples: | |
name: Examples | |
runs-on: ubuntu-latest | |
env: {"RUSTFLAGS": "-D warnings"} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@nightly | |
- run: cargo build --examples | |
crates_io_publish: | |
name: Publish (crates.io) | |
if: startsWith(github.ref, 'refs/tags/v') | |
needs: | |
- build | |
- test | |
- clippy | |
- format | |
- examples | |
- doc | |
runs-on: ubuntu-latest | |
timeout-minutes: 25 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@nightly | |
- name: cargo-release Cache | |
id: cargo_release_cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cargo/bin/cargo-release | |
key: ${{ runner.os }}-cargo-release | |
- run: cargo install cargo-release | |
if: steps.cargo_release_cache.outputs.cache-hit != 'true' | |
- name: cargo login | |
run: cargo login ${{ secrets.CRATES_IO_TOKEN }} | |
- name: "cargo release publish" | |
run: |- | |
cargo release \ | |
publish \ | |
--all-features \ | |
--allow-branch HEAD \ | |
--no-confirm \ | |
--execute |