grokkit/.gitea/workflows/ci.yml
Greg Gauthier 0aa806be70
Some checks failed
CI / Test (push) Failing after 25s
CI / Lint (push) Has been skipped
CI / Build (push) Has been skipped
feat(cmd): add AI documentation generation and command tests
- Implemented `grokkit docs` command for generating language-specific documentation comments (godoc, PEP 257, Doxygen, etc.) with previews, backups, and auto-apply option
- Extracted message builder functions for commit, history, pr-describe, and review commands
- Added comprehensive unit tests for all command message builders (commit_test.go, docs_test.go, history_test.go, lint_test.go, prdescribe_test.go, review_test.go)
- Enforced 70% test coverage threshold in CI workflow
- Added .golangci.yml configuration with linters like govet, errcheck, staticcheck
- Updated Makefile to include -race in tests and add help target
- Updated README.md with new docs command details, workflows, and quality features
- Added .claude/ to .gitignore
- Configured default model for docs command in config.go
2026-03-02 20:13:50 +00:00

86 lines
1.9 KiB
YAML

name: CI
on:
push:
branches: [master, main]
pull_request:
branches: [master, main]
jobs:
test:
name: Test
runs-on: ubuntu-gitea
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
- name: Cache Go modules
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Download dependencies
run: go mod download
- name: Run tests
env:
XAI_API_KEY: ${{ secrets.XAI_API_KEY }}
run: |
go test -v -race -coverprofile=coverage.out ./...
- name: Display coverage summary
run: |
go tool cover -func=coverage.out | tail -1
- name: Enforce coverage threshold
run: |
PCT=$(go tool cover -func=coverage.out | tail -1 | awk '{print $3}' | tr -d '%')
awk "BEGIN { exit ($PCT < 70) }" || (echo "Coverage ${PCT}% is below 70%" && exit 1)
lint:
name: Lint
runs-on: ubuntu-gitea
needs: [test]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
with:
version: latest
build:
name: Build
runs-on: ubuntu-gitea
needs: [test]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
- name: Build
run: make build
- name: Verify binary
run: |
./build/grokkit --help
ls -lh build/grokkit