basefmt 0.1.0

A formatter that applies universal formatting rules to any text file
Documentation
name: Test

on:
  push:

permissions:
  contents: write

jobs:
  test:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/create-github-app-token@v1
        id: app-token
        with:
          app-id: ${{ secrets.APP_ID }}
          private-key: ${{ secrets.APP_PRIVATE_KEY }}

      - uses: actions/checkout@v5
        with:
          persist-credentials: false

      - name: Setup mise
        uses: jdx/mise-action@v2

      - name: Cache Rust dependencies
        uses: Swatinem/rust-cache@v2

      - name: Run cargo test
        run: cargo test

      - name: Cache pre-commit
        uses: actions/cache@v4
        with:
          path: ~/.cache/pre-commit
          key: ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
          restore-keys: |
            ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
            ${{ runner.os }}-pre-commit-

      - name: Run pre-commit
        id: pre-commit
        run: |
          pip install pre-commit
          pre-commit run --all-files

      - name: Commit formatted files
        if: ${{ !cancelled() }}
        uses: suzuki-shunsuke/commit-action@v0.0.13
        with:
          commit_message: 'style: auto-format'
          workflow: deny
          github_token: ${{ steps.app-token.outputs.token }}