38 lines
1009 B
YAML
38 lines
1009 B
YAML
# 前端类型检查 + 单元测试(push master/feat/* 或向 master 发 PR 时触发)
|
||
name: Push & PR Check
|
||
|
||
on:
|
||
push:
|
||
branches: [master, 'feat/**']
|
||
pull_request:
|
||
branches: [master]
|
||
|
||
jobs:
|
||
check:
|
||
runs-on: windows
|
||
steps:
|
||
- uses: actions/checkout@v4
|
||
with:
|
||
fetch-depth: 0
|
||
|
||
- uses: pnpm/action-setup@v4
|
||
|
||
- name: Setup Node.js
|
||
uses: actions/setup-node@v4
|
||
with:
|
||
node-version-file: '.nvmrc'
|
||
cache: 'pnpm'
|
||
|
||
# 服务端 commit message 校验(lefthook 在 agent 沙箱内会静默失效,此为机器层硬补偿)
|
||
- name: Commit message 校验
|
||
env:
|
||
EVENT_NAME: ${{ github.event_name }}
|
||
BEFORE_SHA: ${{ github.event.before }}
|
||
BASE_SHA: ${{ github.event.pull_request.base.sha }}
|
||
HEAD_SHA: ${{ github.sha }}
|
||
run: node .gitea/scripts/check-commit-msg.mjs
|
||
|
||
- run: pnpm install --frozen-lockfile
|
||
- run: pnpm typecheck
|
||
- run: pnpm test
|