Skip to content

build

build #858

Workflow file for this run

on:
schedule:
- cron: '0 0 * * *'
pull_request:
branches:
- main
push:
branches:
- main
tags:
- 'v*.*.*'
name: build
env:
CARGO_UNSTABLE_SPARSE_REGISTRY: true
jobs:
build:
name: Check on ${{ matrix.rust }}
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- 1.61.0 # MSRV
- stable
- nightly
steps:
- uses: actions/checkout@v3
- name: Install ${{ matrix.rust }}
run: |
rustup toolchain install ${{ matrix.rust }} --profile minimal --component rustfmt,clippy
rustup default ${{ matrix.rust }}
- name: Run cargo check
run: cargo check
- name: Run cargo fmt
run: cargo fmt --all -- --check
- name: Run cargo clippy
run: |
cargo clippy -- \
-D warnings \
-W clippy::nursery \
-W clippy::as_conversions \
-W clippy::cast_lossless \
-W clippy::cast_possible_truncation \
-W clippy::cast_possible_wrap \
-W clippy::cloned_instead_of_copied \
-W clippy::map_unwrap_or \
-W clippy::missing_panics_doc \
-W clippy::must_use_candidate \
-W clippy::redundant_closure_for_method-calls \
-W clippy::semicolon_if_nothing_returned \
-W clippy::unnecessary_wraps \
-W clippy::unreadable_literal \
-W clippy::unused_self
- name: Run cargo test
run: cargo test --release --all-features
- name: Run cargo test (no-default-features)
run: cargo test --release --no-default-features --features alloc
- name: Run cargo doc
run: cargo doc --release --all-features
env:
RUSTDOCFLAGS: "-Dwarnings"
publish:
name: Publish
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')"
needs: [ build ]
steps:
- uses: actions/checkout@v3
- name: Install latest stable
run: |
rustup toolchain install stable --profile minimal
rustup default stable
- name: Run cargo publish
run: cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_TOKEN }}