pnpm/action-setup's self-installer fails on Node 24 ("Running
self-installer..." exits 1), breaking both workflows. Use corepack
instead, which picks up the pnpm version from the packageManager field
and matches how the Dockerfile installs it.
Also move upload-artifact to v4, since v3 is retired.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
70 lines
1.8 KiB
YAML
70 lines
1.8 KiB
YAML
name: Code Quality Check
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- master
|
|
- develop
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
- master
|
|
- develop
|
|
|
|
jobs:
|
|
quality-check:
|
|
name: Lint & Type Check
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '24'
|
|
|
|
- name: Setup pnpm
|
|
run: corepack enable
|
|
|
|
- name: Get pnpm store directory
|
|
shell: bash
|
|
run: |
|
|
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
|
|
|
|
- name: Setup pnpm cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ${{ env.STORE_PATH }}
|
|
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-pnpm-store-
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Run ESLint
|
|
run: pnpm run lint
|
|
|
|
- name: Run TypeScript type check
|
|
run: pnpm run typecheck
|
|
|
|
- name: Comment PR on failure
|
|
if: failure() && github.event_name == 'pull_request'
|
|
uses: actions/github-script@v7
|
|
with:
|
|
script: |
|
|
github.rest.issues.createComment({
|
|
issue_number: context.issue.number,
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
body: '❌ Code quality check failed. Please run `./windsurf-commands.sh lintfix` and `./windsurf-commands.sh typecheck` locally to fix issues.'
|
|
})
|
|
|
|
- name: Notify on failure
|
|
if: failure()
|
|
run: |
|
|
echo "::error::Code quality check failed. Please fix linting and type errors before merging."
|