name: Best Practices

on: [push, pull_request]

jobs:
    lint:
        runs-on: ubuntu-latest

        steps:
            - name: Checkout code
              uses: actions/checkout@v4
              with:
                  fetch-depth: 0

            - name: Setup pnpm
              uses: pnpm/action-setup@v3
              with:
                  version: 8

            - name: Install dependencies
              run: pnpm install

            - name: Run ESLint
              run: pnpm run lint
    format:
        runs-on: ubuntu-latest

        steps:
            - name: Checkout code
              uses: actions/checkout@v4
              with:
                  fetch-depth: 0

            - name: Setup pnpm
              uses: pnpm/action-setup@v3
              with:
                  version: 8

            - name: Install dependencies
              run: pnpm install

            - name: Run Prettier
              run: pnpm run prettier
