Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull Request Overview
This PR adds a new GitHub Actions workflow for code quality checks that runs on pull requests. The workflow implements automated quality gates to ensure code meets project standards before merging.
- Introduces a comprehensive code quality workflow with three parallel jobs
- Sets up automated linting, formatting validation, and type checking
- Configures pnpm caching for improved CI performance
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| lint: | ||
| runs-on: ubuntu-latest | ||
| name: pnpm lint | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Install Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
|
|
||
| - uses: pnpm/action-setup@v4 | ||
| name: Install pnpm | ||
| with: | ||
| version: 9.0.6 | ||
| run_install: false | ||
|
|
||
| - name: Get pnpm store directory | ||
| id: pnpm-cache | ||
| run: | | ||
| echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT | ||
|
|
||
| - uses: actions/cache@v4 | ||
| name: Setup pnpm cache | ||
| with: | ||
| path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} | ||
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-pnpm-store- | ||
|
|
||
| - name: Install dependencies | ||
| run: pnpm install | ||
|
|
||
| - run: pnpm lint | ||
|
|
||
| format: | ||
| runs-on: ubuntu-latest | ||
| name: pnpm format:check | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Install Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
|
|
||
| - uses: pnpm/action-setup@v4 | ||
| name: Install pnpm | ||
| with: | ||
| version: 9.0.6 | ||
| run_install: false | ||
|
|
||
| - name: Get pnpm store directory | ||
| id: pnpm-cache | ||
| run: | | ||
| echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT | ||
|
|
||
| - uses: actions/cache@v4 | ||
| name: Setup pnpm cache | ||
| with: | ||
| path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} | ||
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-pnpm-store- | ||
|
|
||
| - name: Install dependencies | ||
| run: pnpm install | ||
|
|
||
| - run: pnpm format:check | ||
|
|
||
| typecheck: | ||
| runs-on: ubuntu-latest | ||
| name: pnpm typecheck | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Install Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
|
|
||
| - uses: pnpm/action-setup@v4 | ||
| name: Install pnpm | ||
| with: | ||
| version: 9.0.6 | ||
| run_install: false | ||
|
|
||
| - name: Get pnpm store directory | ||
| id: pnpm-cache | ||
| run: | | ||
| echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT | ||
|
|
||
| - uses: actions/cache@v4 | ||
| name: Setup pnpm cache | ||
| with: | ||
| path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} | ||
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-pnpm-store- | ||
|
|
||
| - name: Install dependencies | ||
| run: pnpm install | ||
|
|
There was a problem hiding this comment.
The Node.js setup steps are duplicated across all three jobs. Consider creating a reusable composite action or using a shared setup job to reduce duplication and ensure consistency.
| lint: | |
| runs-on: ubuntu-latest | |
| name: pnpm lint | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - uses: pnpm/action-setup@v4 | |
| name: Install pnpm | |
| with: | |
| version: 9.0.6 | |
| run_install: false | |
| - name: Get pnpm store directory | |
| id: pnpm-cache | |
| run: | | |
| echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT | |
| - uses: actions/cache@v4 | |
| name: Setup pnpm cache | |
| with: | |
| path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install dependencies | |
| run: pnpm install | |
| - run: pnpm lint | |
| format: | |
| runs-on: ubuntu-latest | |
| name: pnpm format:check | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - uses: pnpm/action-setup@v4 | |
| name: Install pnpm | |
| with: | |
| version: 9.0.6 | |
| run_install: false | |
| - name: Get pnpm store directory | |
| id: pnpm-cache | |
| run: | | |
| echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT | |
| - uses: actions/cache@v4 | |
| name: Setup pnpm cache | |
| with: | |
| path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install dependencies | |
| run: pnpm install | |
| - run: pnpm format:check | |
| typecheck: | |
| runs-on: ubuntu-latest | |
| name: pnpm typecheck | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - uses: pnpm/action-setup@v4 | |
| name: Install pnpm | |
| with: | |
| version: 9.0.6 | |
| run_install: false | |
| - name: Get pnpm store directory | |
| id: pnpm-cache | |
| run: | | |
| echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT | |
| - uses: actions/cache@v4 | |
| name: Setup pnpm cache | |
| with: | |
| path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install dependencies | |
| run: pnpm install | |
| # Shared setup steps for Node.js and pnpm, using YAML anchor | |
| _setup-steps: &setup-steps | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - uses: pnpm/action-setup@v4 | |
| name: Install pnpm | |
| with: | |
| version: 9.0.6 | |
| run_install: false | |
| - name: Get pnpm store directory | |
| id: pnpm-cache | |
| run: | | |
| echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT | |
| - uses: actions/cache@v4 | |
| name: Setup pnpm cache | |
| with: | |
| path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install dependencies | |
| run: pnpm install | |
| lint: | |
| runs-on: ubuntu-latest | |
| name: pnpm lint | |
| steps: | |
| *setup-steps | |
| - run: pnpm lint | |
| format: | |
| runs-on: ubuntu-latest | |
| name: pnpm format:check | |
| steps: | |
| *setup-steps | |
| - run: pnpm format:check | |
| typecheck: | |
| runs-on: ubuntu-latest | |
| name: pnpm typecheck | |
| steps: | |
| *setup-steps |
| lint: | ||
| runs-on: ubuntu-latest | ||
| name: pnpm lint | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Install Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
|
|
||
| - uses: pnpm/action-setup@v4 | ||
| name: Install pnpm | ||
| with: | ||
| version: 9.0.6 | ||
| run_install: false | ||
|
|
||
| - name: Get pnpm store directory | ||
| id: pnpm-cache | ||
| run: | | ||
| echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT | ||
|
|
||
| - uses: actions/cache@v4 | ||
| name: Setup pnpm cache | ||
| with: | ||
| path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} | ||
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-pnpm-store- | ||
|
|
||
| - name: Install dependencies | ||
| run: pnpm install | ||
|
|
||
| - run: pnpm lint | ||
|
|
||
| format: | ||
| runs-on: ubuntu-latest | ||
| name: pnpm format:check | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Install Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
|
|
||
| - uses: pnpm/action-setup@v4 | ||
| name: Install pnpm | ||
| with: | ||
| version: 9.0.6 | ||
| run_install: false | ||
|
|
||
| - name: Get pnpm store directory | ||
| id: pnpm-cache | ||
| run: | | ||
| echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT | ||
|
|
||
| - uses: actions/cache@v4 | ||
| name: Setup pnpm cache | ||
| with: | ||
| path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} | ||
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-pnpm-store- | ||
|
|
||
| - name: Install dependencies | ||
| run: pnpm install | ||
|
|
||
| - run: pnpm format:check | ||
|
|
||
| typecheck: | ||
| runs-on: ubuntu-latest | ||
| name: pnpm typecheck | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Install Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
|
|
||
| - uses: pnpm/action-setup@v4 | ||
| name: Install pnpm | ||
| with: | ||
| version: 9.0.6 | ||
| run_install: false | ||
|
|
||
| - name: Get pnpm store directory | ||
| id: pnpm-cache | ||
| run: | | ||
| echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT | ||
|
|
||
| - uses: actions/cache@v4 | ||
| name: Setup pnpm cache | ||
| with: | ||
| path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} | ||
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-pnpm-store- | ||
|
|
||
| - name: Install dependencies | ||
| run: pnpm install | ||
|
|
There was a problem hiding this comment.
The Node.js setup steps are duplicated across all three jobs. Consider creating a reusable composite action or using a shared setup job to reduce duplication and ensure consistency.
| lint: | |
| runs-on: ubuntu-latest | |
| name: pnpm lint | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - uses: pnpm/action-setup@v4 | |
| name: Install pnpm | |
| with: | |
| version: 9.0.6 | |
| run_install: false | |
| - name: Get pnpm store directory | |
| id: pnpm-cache | |
| run: | | |
| echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT | |
| - uses: actions/cache@v4 | |
| name: Setup pnpm cache | |
| with: | |
| path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install dependencies | |
| run: pnpm install | |
| - run: pnpm lint | |
| format: | |
| runs-on: ubuntu-latest | |
| name: pnpm format:check | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - uses: pnpm/action-setup@v4 | |
| name: Install pnpm | |
| with: | |
| version: 9.0.6 | |
| run_install: false | |
| - name: Get pnpm store directory | |
| id: pnpm-cache | |
| run: | | |
| echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT | |
| - uses: actions/cache@v4 | |
| name: Setup pnpm cache | |
| with: | |
| path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install dependencies | |
| run: pnpm install | |
| - run: pnpm format:check | |
| typecheck: | |
| runs-on: ubuntu-latest | |
| name: pnpm typecheck | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - uses: pnpm/action-setup@v4 | |
| name: Install pnpm | |
| with: | |
| version: 9.0.6 | |
| run_install: false | |
| - name: Get pnpm store directory | |
| id: pnpm-cache | |
| run: | | |
| echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT | |
| - uses: actions/cache@v4 | |
| name: Setup pnpm cache | |
| with: | |
| path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install dependencies | |
| run: pnpm install | |
| # Shared setup steps for Node.js and pnpm | |
| _setup-steps: &setup-steps | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - uses: pnpm/action-setup@v4 | |
| name: Install pnpm | |
| with: | |
| version: 9.0.6 | |
| run_install: false | |
| - name: Get pnpm store directory | |
| id: pnpm-cache | |
| run: | | |
| echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT | |
| - uses: actions/cache@v4 | |
| name: Setup pnpm cache | |
| with: | |
| path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install dependencies | |
| run: pnpm install | |
| lint: | |
| runs-on: ubuntu-latest | |
| name: pnpm lint | |
| steps: | |
| <<: *setup-steps | |
| - run: pnpm lint | |
| format: | |
| runs-on: ubuntu-latest | |
| name: pnpm format:check | |
| steps: | |
| <<: *setup-steps | |
| - run: pnpm format:check | |
| typecheck: | |
| runs-on: ubuntu-latest | |
| name: pnpm typecheck | |
| steps: | |
| <<: *setup-steps |
| lint: | ||
| runs-on: ubuntu-latest | ||
| name: pnpm lint | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Install Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
|
|
||
| - uses: pnpm/action-setup@v4 | ||
| name: Install pnpm | ||
| with: | ||
| version: 9.0.6 | ||
| run_install: false | ||
|
|
||
| - name: Get pnpm store directory | ||
| id: pnpm-cache | ||
| run: | | ||
| echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT | ||
|
|
||
| - uses: actions/cache@v4 | ||
| name: Setup pnpm cache | ||
| with: | ||
| path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} | ||
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-pnpm-store- | ||
|
|
||
| - name: Install dependencies | ||
| run: pnpm install | ||
|
|
||
| - run: pnpm lint | ||
|
|
||
| format: | ||
| runs-on: ubuntu-latest | ||
| name: pnpm format:check | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Install Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
|
|
||
| - uses: pnpm/action-setup@v4 | ||
| name: Install pnpm | ||
| with: | ||
| version: 9.0.6 | ||
| run_install: false | ||
|
|
||
| - name: Get pnpm store directory | ||
| id: pnpm-cache | ||
| run: | | ||
| echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT | ||
|
|
||
| - uses: actions/cache@v4 | ||
| name: Setup pnpm cache | ||
| with: | ||
| path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} | ||
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-pnpm-store- | ||
|
|
||
| - name: Install dependencies | ||
| run: pnpm install | ||
|
|
||
| - run: pnpm format:check | ||
|
|
||
| typecheck: | ||
| runs-on: ubuntu-latest | ||
| name: pnpm typecheck | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Install Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
|
|
||
| - uses: pnpm/action-setup@v4 | ||
| name: Install pnpm | ||
| with: | ||
| version: 9.0.6 | ||
| run_install: false | ||
|
|
||
| - name: Get pnpm store directory | ||
| id: pnpm-cache | ||
| run: | | ||
| echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT | ||
|
|
||
| - uses: actions/cache@v4 | ||
| name: Setup pnpm cache | ||
| with: | ||
| path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} | ||
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-pnpm-store- | ||
|
|
||
| - name: Install dependencies | ||
| run: pnpm install | ||
|
|
There was a problem hiding this comment.
The Node.js setup steps are duplicated across all three jobs. Consider creating a reusable composite action or using a shared setup job to reduce duplication and ensure consistency.
| lint: | |
| runs-on: ubuntu-latest | |
| name: pnpm lint | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - uses: pnpm/action-setup@v4 | |
| name: Install pnpm | |
| with: | |
| version: 9.0.6 | |
| run_install: false | |
| - name: Get pnpm store directory | |
| id: pnpm-cache | |
| run: | | |
| echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT | |
| - uses: actions/cache@v4 | |
| name: Setup pnpm cache | |
| with: | |
| path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install dependencies | |
| run: pnpm install | |
| - run: pnpm lint | |
| format: | |
| runs-on: ubuntu-latest | |
| name: pnpm format:check | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - uses: pnpm/action-setup@v4 | |
| name: Install pnpm | |
| with: | |
| version: 9.0.6 | |
| run_install: false | |
| - name: Get pnpm store directory | |
| id: pnpm-cache | |
| run: | | |
| echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT | |
| - uses: actions/cache@v4 | |
| name: Setup pnpm cache | |
| with: | |
| path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install dependencies | |
| run: pnpm install | |
| - run: pnpm format:check | |
| typecheck: | |
| runs-on: ubuntu-latest | |
| name: pnpm typecheck | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - uses: pnpm/action-setup@v4 | |
| name: Install pnpm | |
| with: | |
| version: 9.0.6 | |
| run_install: false | |
| - name: Get pnpm store directory | |
| id: pnpm-cache | |
| run: | | |
| echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT | |
| - uses: actions/cache@v4 | |
| name: Setup pnpm cache | |
| with: | |
| path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install dependencies | |
| run: pnpm install | |
| # Shared setup steps for all jobs | |
| _setup-steps: &setup-steps | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - uses: pnpm/action-setup@v4 | |
| name: Install pnpm | |
| with: | |
| version: 9.0.6 | |
| run_install: false | |
| - name: Get pnpm store directory | |
| id: pnpm-cache | |
| run: | | |
| echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT | |
| - uses: actions/cache@v4 | |
| name: Setup pnpm cache | |
| with: | |
| path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install dependencies | |
| run: pnpm install | |
| lint: | |
| runs-on: ubuntu-latest | |
| name: pnpm lint | |
| steps: | |
| <<: *setup-steps | |
| - run: pnpm lint | |
| format: | |
| runs-on: ubuntu-latest | |
| name: pnpm format:check | |
| steps: | |
| <<: *setup-steps | |
| - run: pnpm format:check | |
| typecheck: | |
| runs-on: ubuntu-latest | |
| name: pnpm typecheck | |
| steps: | |
| <<: *setup-steps |
| - uses: pnpm/action-setup@v4 | ||
| name: Install pnpm | ||
| with: | ||
| version: 9.0.6 |
There was a problem hiding this comment.
The pnpm version is hardcoded and duplicated across all jobs. Consider using a workflow-level environment variable or input to centralize version management and make updates easier.
| - uses: pnpm/action-setup@v4 | ||
| name: Install pnpm | ||
| with: | ||
| version: 9.0.6 |
There was a problem hiding this comment.
The pnpm version is hardcoded and duplicated across all jobs. Consider using a workflow-level environment variable or input to centralize version management and make updates easier.
| - uses: pnpm/action-setup@v4 | ||
| name: Install pnpm | ||
| with: | ||
| version: 9.0.6 |
There was a problem hiding this comment.
The pnpm version is hardcoded and duplicated across all jobs. Consider using a workflow-level environment variable or input to centralize version management and make updates easier.
| - name: Get pnpm store directory | ||
| id: pnpm-cache | ||
| run: | | ||
| echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT | ||
|
|
||
| - uses: actions/cache@v4 | ||
| name: Setup pnpm cache | ||
| with: | ||
| path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} | ||
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-pnpm-store- |
There was a problem hiding this comment.
The pnpm cache setup is identical across all three jobs. This entire block of steps should be extracted into a reusable composite action to eliminate duplication and ensure consistency.
No description provided.