Currently, the `Makefile` is not well structured, and does not follow best practices. With the help of [`checkmake`](https://github.com/checkmake/checkmake), the Makefile can be forced to follow them. ### Decisions - Added CI job `lint-makefile`, which forces the Makefile to conform to standards. - The `make help` was set as the default target. This is common practice in the industry. - The `make help` uses `grep` | `awk` to create a command table from `##` comments after each target. It seems a bit icky, but it is something that Docker, Kubernetes, and Helm all do. Reviewed-on: #4 Co-authored-by: M.V. Hutz <git@maximhutz.me> Co-committed-by: M.V. Hutz <git@maximhutz.me>
67 lines
1.3 KiB
YAML
67 lines
1.3 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
|
|
jobs:
|
|
lint-go:
|
|
name: Go Lint
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: go.mod
|
|
|
|
- name: Check go mod tidy
|
|
run: go mod tidy && git diff --exit-code go.mod go.sum
|
|
|
|
- uses: golangci/golangci-lint-action@v7
|
|
with:
|
|
version: latest
|
|
|
|
test-unit:
|
|
name: Unit Tests
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: go.mod
|
|
|
|
- name: Run unit tests
|
|
run: make test-unit
|
|
|
|
test-fuzz:
|
|
name: Fuzz Tests
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: go.mod
|
|
|
|
- name: Run fuzz tests
|
|
run: make test-fuzz
|
|
|
|
test-mutation:
|
|
name: Mutation Tests
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: go.mod
|
|
|
|
- name: Install gremlins
|
|
run: go install github.com/go-gremlins/gremlins/cmd/gremlins@latest
|
|
|
|
- name: Run mutation tests
|
|
run: make test-mutation
|