ci: enforce public quality gates #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ci-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| commit-lint: | |
| if: github.event_name == 'pull_request' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Validate Conventional Commits | |
| env: | |
| BASE_SHA: ${{ github.event.pull_request.base.sha }} | |
| HEAD_SHA: ${{ github.event.pull_request.head.sha }} | |
| run: | | |
| pattern='^(feat|fix|docs|refactor|perf|test|chore|ci|revert|style|build)(\([a-z0-9._-]+\))?!?: .+' | |
| bad=0 | |
| while IFS= read -r sha; do | |
| msg=$(git log -1 --format='%s' "$sha") | |
| if [[ "$msg" =~ ^Merge\ ]] || [[ "$msg" =~ ^Revert\ \" ]]; then | |
| continue | |
| fi | |
| if ! [[ "$msg" =~ $pattern ]]; then | |
| echo "::error::Bad commit message: $msg ($sha)" | |
| bad=1 | |
| fi | |
| done < <(git rev-list "$BASE_SHA".."$HEAD_SHA") | |
| if [[ "$bad" -eq 1 ]]; then | |
| echo "Expected format: type(scope): description" | |
| exit 1 | |
| fi | |
| quality: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 60 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 | |
| with: | |
| enable-cache: true | |
| cache-python: true | |
| - name: Sync locked dependencies | |
| run: uv sync --frozen --extra full | |
| - name: Run PR quality lane | |
| env: | |
| UV_NO_SYNC: "1" | |
| run: ./scripts/test/check_pr.sh |