envir 1.3.0

Deserialize/serialize struct from/to env
Documentation
on: [push, pull_request]

env:
  CARGO_TERM_COLOR: always

jobs:
  lint_fmt:
    name: cargo fmt
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt
      - name: Check formating
        run: cargo fmt -- --check

  lint_clippy:
    name: Clippy
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: clippy
      - name: Run clippy
        run: cargo clippy --all-targets --all-features -- --deny warnings

  tests:
    name: Tests
    strategy:
      matrix:
        rust: ["stable", "beta", "nightly"]
        os: ["ubuntu-latest", "macos-latest"]
        mode: ["debug", "release"]
    runs-on: ${{ matrix.os }}

    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: ${{ matrix.rust }}

      - name: Run tests (debug)
        if: matrix.mode == 'debug'
        run: cargo test --workspace --all-features

      - name: Run tests (release)
        if: matrix.mode == 'release'
        run: cargo test --workspace --all-features --release