1
0
Fork 0
mirror of https://github.com/imjasonh/client-go2 synced 2026-07-11 02:22:02 +00:00
client-go2/.github/workflows/build.yaml
Jason Hall 74aace1a2d
Update to use stable Go and add comprehensive CI/CD
- Replace gotip with stable Go in GitHub Actions
- Add automatic GVR inference for Kubernetes types
- Rename API: NewClient (inferred GVR) and NewClientGVR (explicit)
- Add comprehensive test coverage including e2e tests
- Update CI to include linting, unit tests, and e2e tests with kind
- Add .gitignore for common Go development files
- Update README with usage examples and features

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-23 11:41:20 -04:00

49 lines
943 B
YAML

name: Build
on:
push:
branches: ['main']
pull_request:
workflow_dispatch:
jobs:
build:
name: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 'stable'
- run: go build ./...
- run: go vet ./...
- run: |
if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then
echo "Code is not formatted. Run 'gofmt -s -w .'"
gofmt -s -d .
exit 1
fi
- run: |
go mod tidy
git diff --exit-code go.mod go.sum
- name: Run unit tests
run: go test ./... -v -race
- uses: chainguard-dev/actions/setup-kind@main
with:
k8s-version: v1.33.0
- run: |
kubectl cluster-info
kubectl get nodes
- name: Run e2e tests
run: go test ./... -v -tags=e2e
- name: Run example
run: go run ./main.go