73 lines
1.7 KiB
YAML
73 lines
1.7 KiB
YAML
name: Lint and Code Quality Check
|
|
|
|
on:
|
|
push:
|
|
branches: [main, develop]
|
|
paths-ignore:
|
|
- '**/*.md'
|
|
- '**/*.gitignore'
|
|
- '**/*.gitattributes'
|
|
pull_request:
|
|
branches: [main, develop]
|
|
paths-ignore:
|
|
- '**/*.md'
|
|
- '**/*.gitignore'
|
|
- '**/*.gitattributes'
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
lint:
|
|
name: Lint Check
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
cache: 'pnpm'
|
|
|
|
- name: Install pnpm
|
|
uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 8
|
|
run_install: false
|
|
|
|
- name: Get pnpm store directory
|
|
id: pnpm-cache
|
|
shell: bash
|
|
run: |
|
|
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
|
|
|
|
- name: Setup pnpm cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ${{ steps.pnpm-cache.outputs.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: TypeScript type check
|
|
run: pnpm exec tsc --noEmit
|
|
|
|
- name: ESLint check
|
|
run: pnpm lint
|
|
|
|
- name: Prettier format check
|
|
run: pnpm format --check
|
|
|
|
- name: Check commit messages (PR only)
|
|
if: github.event_name == 'pull_request'
|
|
uses: wagoid/commitlint-github-action@v5
|