grokkit/.gitea/workflows/ci.yml
Greg Gauthier 6005a2192a
All checks were successful
CI / Test (push) Successful in 35s
CI / Lint (push) Successful in 26s
CI / Build (push) Successful in 19s
chore(ci): disable coverage threshold enforcement
Comment out the step in CI workflow that enforces a minimum test coverage of 65%.
2026-03-03 22:14:07 +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 < 65) }" || (echo "Coverage ${PCT}% is below 65%" && 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@v7
with:
version: v2.1.6
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