mmoxi 0.4.3

tools for IBM Storage Scale file systems
Documentation
---

name: rust

on:
  pull_request:
    paths:
      - '.github/workflows/rust.yml'
      - '.rustfmt.toml'
      - 'rust-toolchain.toml'
      - 'Cargo.toml'
      - 'Cargo.lock'
      - 'src/**'
  push:
    branches:
      - main
      - wip/next
    paths:
      - '.github/workflows/rust.yml'
      - '.rustfmt.toml'
      - 'rust-toolchain.toml'
      - 'Cargo.toml'
      - 'Cargo.lock'
      - 'src/**'

concurrency:
  group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
  cancel-in-progress: true

env:
  CARGO_TERM_COLOR: always
  CARGO_TERM_VERBOSE: true

jobs:

  check:
    name: cargo fmt --check and clippy
    runs-on: ubuntu-latest

    steps:

      - name: checkout
        uses: actions/checkout@v6

      - name: set up rust toolchain
        uses: actions-rust-lang/setup-rust-toolchain@v1
        with:
          components: clippy, rustfmt
          rustflags: ''

      - name: check formatting
        run: cargo fmt --check

      - name: cargo clippy
        run: cargo clippy

  msrv:
    name: msrv
    runs-on: ubuntu-latest

    outputs:
      msrv: ${{ steps.msrv.outputs.msrv }}

    steps:

      - name: checkout
        uses: actions/checkout@v6

      - name: install cargo-msrv
        uses: taiki-e/install-action@v2
        with:
          tool: cargo-msrv

      - name: show cargo-msrv version
        run: cargo msrv --version

      - name: get msrv
        run: |
          msrv=$(cargo msrv show --output-format minimal)
          echo "msrv=$msrv" >> "$GITHUB_OUTPUT"
        id: msrv

      - name: show msrv
        run: echo ${{ steps.msrv.outputs.msrv }}

  test:
    name: cargo check, build and test
    runs-on: ubuntu-latest
    needs: msrv

    strategy:
      matrix:
        toolchain:
          - null # this will use rust-toolchain.toml
          - ${{ needs.msrv.outputs.msrv }}

    steps:

      - name: checkout
        uses: actions/checkout@v6

      - name: set up rust toolchain
        uses: actions-rust-lang/setup-rust-toolchain@v1
        with:
          toolchain: ${{ matrix.toolchain }}

      - name: cargo check
        run: cargo check

      - name: cargo build
        run: cargo build

      - name: cargo test
        run: cargo test

...