autocommit-rs 0.1.2

Tool that generates conventional commits from staged changes and executes the commit in one go.
name: CI

on:
  push:
    branches: [main]
    paths:
      - '**'
      - '.github/workflows/ci.yml'
  pull_request:
    branches: [main]
    paths:
      - '**'
      - '.github/workflows/ci.yml'
  workflow_dispatch:

env:
  CARGO_TERM_COLOR: always

jobs:
  build-and-test:
    name: Build & Test
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4

      - name: Install Rust toolchain
        uses: actions-rust-lang/setup-rust-toolchain@v1
        with:
          toolchain: stable

      - name: Rust Cache
        uses: Swatinem/rust-cache@v2
        with:
          workspaces: .

      - name: Build
        run: cargo build --verbose

      - name: Run tests
        run: cargo test --verbose

  lint:
    name: Lint & Format
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Install Rust toolchain
        uses: actions-rust-lang/setup-rust-toolchain@v1
        with:
          toolchain: stable
          components: clippy, rustfmt

      - name: Rust Cache
        uses: Swatinem/rust-cache@v2
        with:
          workspaces: .

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

      - name: Clippy
        run: cargo clippy -- -D warnings