chksum 0.4.0

An implementation of hash functions with a straightforward interface for computing digests of bytes, files, directories, and more.
Documentation
name: Rust

env:
  CARGO_TERM_COLOR: always

permissions:
  contents: read

on:
  push:
    branches:
      - master
    paths:
      - ".github/workflows/*.yml"
      - "Cargo.toml"
      - "examples/**.rs"
      - "src/**.rs"
  pull_request:
    branches:
      - master
    paths:
      - ".github/workflows/*.yml"
      - "Cargo.toml"
      - "examples/**.rs"
      - "src/**.rs"

jobs:
  lint:
    runs-on: ubuntu-latest
    name: Lint
    permissions:
      checks: write
      contents: write
      pull-requests: write
    steps:
      - name: Repository checkout
        uses: actions/checkout@v3
      - name: Setup Rust
        uses: actions-rs/toolchain@v1
        with:
          toolchain: nightly
          default: true
          profile: minimal
          components: rustfmt, clippy
      - name: Run cargo fmt
        uses: actions-rs/cargo@v1
        with:
          command: fmt
          args: --check --verbose
      - name: Run cargo clippy
        uses: actions-rs/clippy-check@v1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          args: --all-features -- --deny clippy::cargo

  build-and-test-linux:
    needs:
      - lint
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        toolchain: [1.74.0, stable, nightly]
    name: "Build and test (OS: Linux, Toolchain: ${{ matrix.toolchain }})"
    steps:
      - name: Repository checkout
        uses: actions/checkout@v3
      - name: Setup Rust
        uses: actions-rs/toolchain@v1
        with:
          toolchain: ${{ matrix.toolchain }}
          default: true
          profile: minimal
      - name: Run cargo build
        uses: actions-rs/cargo@v1
        with:
          command: build
          args: --all-features --verbose
      - name: Run cargo test
        uses: actions-rs/cargo@v1
        with:
          command: test
          args: --all-features --verbose

  build-and-test-macos:
    needs:
      - lint
    runs-on: macos-latest
    strategy:
      fail-fast: false
      matrix:
        toolchain: [1.74.0, stable, nightly]
    name: "Build and test (OS: MacOS, Toolchain: ${{ matrix.toolchain }})"
    steps:
      - name: Repository checkout
        uses: actions/checkout@v3
      - name: Setup Rust
        uses: actions-rs/toolchain@v1
        with:
          toolchain: ${{ matrix.toolchain }}
          default: true
          profile: minimal
      - name: Run cargo build
        uses: actions-rs/cargo@v1
        with:
          command: build
          args: --all-features --verbose
      - name: Run cargo test
        uses: actions-rs/cargo@v1
        with:
          command: test
          args: --all-features --verbose

  build-and-test-windows:
    needs:
      - lint
    runs-on: windows-latest
    strategy:
      fail-fast: false
      matrix:
        toolchain: [1.74.0, stable, nightly]
    name: "Build and test (OS: Windows, Toolchain: ${{ matrix.toolchain }})"
    steps:
      - name: Repository checkout
        uses: actions/checkout@v3
      - name: Setup Rust
        uses: actions-rs/toolchain@v1
        with:
          toolchain: ${{ matrix.toolchain }}
          default: true
          profile: minimal
      - name: Run cargo build
        uses: actions-rs/cargo@v1
        with:
          command: build
          args: --all-features --verbose
      - name: Run cargo test
        uses: actions-rs/cargo@v1
        with:
          command: test
          args: --all-features --verbose