fmt #120
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
name: Rust | |
on: | |
push: | |
pull_request: | |
release: | |
types: [released] | |
jobs: | |
test: | |
strategy: | |
fail-fast: false | |
matrix: | |
toolchain: [stable, nightly] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository and submodules | |
uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@master | |
id: "rust-toolchain" | |
with: | |
targets: thumbv7em-none-eabihf | |
toolchain: ${{ matrix.toolchain }} | |
- name: install cargo-all-features | |
uses: baptiste0928/cargo-install@v2.0.0 | |
with: | |
crate: cargo-all-features | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/git | |
~/.cargo/registry | |
target | |
key: "${{runner.os}} Rust ${{steps.rust-toolchain.outputs.cachekey}} Lock ${{hashFiles('Cargo.lock')}}" | |
- run: cargo check-all-features | |
env: | |
RUST_BACKTRACE: 1 | |
- run: cargo check --all-features #bluescreen-message-nightly feature can not be tested by check-all-features; see https://github.com/frewsxcv/cargo-all-features/issues/43 | |
env: | |
RUST_BACKTRACE: 1 | |
rustfmt: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@nightly | |
with: | |
targets: thumbv7em-none-eabihf | |
components: rustfmt | |
- run: cargo fmt --all -- --check | |
doc2readme: | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/msrd0/cargo-doc2readme:nightly | |
steps: | |
- run: rustup target install thumbv7em-none-eabihf | |
- run: rustup toolchain install nightly --target thumbv7em-none-eabihf | |
- uses: actions/checkout@v3 | |
- run: cargo +nightly doc2readme --expand-macros --all-features --check -p pybadge-high | |
cargo_publish: | |
if: ${{ github.event_name == 'release' }} | |
needs: [test, doc2readme] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: thumbv7em-none-eabihf | |
- uses: msrd0/cargo-publish-action@v1 | |
with: | |
packages: pybadge-high | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} |