Merge pull request #9 from aleksandarskrbic/ui/consistent-help-styling #74
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, go-rewrite] | |
| pull_request: | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.26' | |
| cache: true | |
| - name: gofmt | |
| run: | | |
| unformatted=$(gofmt -l cmd internal) | |
| if [ -n "$unformatted" ]; then | |
| echo "not gofmt'd:"; echo "$unformatted"; exit 1 | |
| fi | |
| - name: vet | |
| run: go vet ./... | |
| # Tests need no Docker: kfake provides an in-process broker speaking the real | |
| # Kafka protocol, so the whole engine is exercised in CI. | |
| - name: test | |
| run: go test -race -timeout 15m ./... | |
| # The static binary is the product; prove it builds the way it ships. | |
| - name: build static binary | |
| env: | |
| CGO_ENABLED: '0' | |
| run: go build -trimpath -ldflags "-s -w" -o /tmp/khaos ./cmd/khaos | |
| - name: smoke test | |
| run: | | |
| /tmp/khaos --version | |
| /tmp/khaos list | |
| /tmp/khaos validate traffic/high-throughput | |
| vulncheck: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.26' | |
| # Reports vulnerabilities in required modules even when the code path that would | |
| # call them is unreachable, so it does not fail the build on its own. | |
| - name: govulncheck | |
| continue-on-error: true | |
| run: | | |
| go install golang.org/x/vuln/cmd/govulncheck@latest | |
| govulncheck ./... | |
| cross-compile: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.26' | |
| # Trivial only because the Kafka client is pure Go. With cgo this job would need a | |
| # C toolchain per target. | |
| - name: build all targets | |
| env: | |
| CGO_ENABLED: '0' | |
| run: | | |
| for target in linux/amd64 linux/arm64 darwin/amd64 darwin/arm64 windows/amd64; do | |
| GOOS=${target%/*} GOARCH=${target#*/} go build -o /dev/null ./cmd/khaos | |
| echo "ok $target" | |
| done |