# ---------------------------------------------------------------
# Lefthook File : lefthook.yml
# File Authors  : 曾奥然 <ccmywish@qq.com>
# Contributors  : Nul None <nul@none.org>
#               |
# Created On    : <2025-10-28>
# Last Modified : <2025-10-28>
# ---------------------------------------------------------------

min_version: 2.0.1

pre-commit:
  only:
    - ref: dev
  parallel: true
  jobs:
    - name: 试运行 DEBUG mode
      # 触发所有 _prelude() 函数检查
      run: |
        just build-in-debug-mode
        ./chsrc-debug get pip
      glob: "*.{c,h}"
      exclude: test/*

    - name: 测试 xy.h
      run: just test-xy
      glob:
        - lib/xy.h
        - test/xy.c

    - name: 测试 framework
      run: just test-fw
      glob:
        - "src/framework/*.{c,h}"
        - src/chsrc-main.c
        - test/fw.c

post-merge:
  only:
    - ref: main
  jobs:
    - name: 测试编译 DEV mode
      run: just build-in-dev-mode

pre-push:
  only:
    - ref: gh-build
  jobs:
    - name: 测试编译 RELEASE mode
      run: just build-in-release-mode

    - name: 测试运行
      run: just test-cli
