ci: clean up workflow (#3)
## Description The current CI workflow was auto-generated by Claude, and is really not intuitive. Fixing it up to make it work better. - Add names for jobs in workflow. - Rename workflow to `ci.yml`. - Added `go mod tidy` as a tasks in the `lint` job. ### Decisions - Chose not to use emojis for workflow or job names. While they look nice, they are unprofessional, and harder to `grep`. Reviewed-on: #3 Co-authored-by: M.V. Hutz <git@maximhutz.me> Co-committed-by: M.V. Hutz <git@maximhutz.me>
This commit was merged in pull request #3.
This commit is contained in:
69
.gitea/workflows/ci.yml
Normal file
69
.gitea/workflows/ci.yml
Normal file
@@ -0,0 +1,69 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
name: Golang 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
|
||||
|
||||
unit-test:
|
||||
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: go test ./... -cover -v
|
||||
|
||||
fuzz-test:
|
||||
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: |
|
||||
for func in $(grep -r --include='*_test.go' -oh 'func Fuzz\w*' . | sed 's/func //'); do
|
||||
go test ./... -fuzz="^${func}$" -fuzztime=30s
|
||||
done
|
||||
|
||||
mutation-test:
|
||||
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: gremlins unleash
|
||||
Reference in New Issue
Block a user