diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..c91b826 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,19 @@ +exclude: ^web/static/ + +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.6.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-merge-conflict + - id: mixed-line-ending + args: [--fix=lf] + + - repo: https://github.com/dnephin/pre-commit-golang + rev: v0.5.1 + hooks: + - id: go-fmt + - id: go-vet + - id: go-unit-tests diff --git a/.woodpecker/build.yaml b/.woodpecker/build.yaml index c452a1e..9044f0b 100644 --- a/.woodpecker/build.yaml +++ b/.woodpecker/build.yaml @@ -1,13 +1,11 @@ when: - - event: [pull_request, push] + - event: pull_request steps: - - name: test + - name: build image: golang:1.25 commands: - - go vet ./... - - test -z "$(gofmt -l .)" - - go test -race ./... + - make build backend_options: kubernetes: serviceAccountName: default diff --git a/.woodpecker/pre-commit.yaml b/.woodpecker/pre-commit.yaml new file mode 100644 index 0000000..d57b508 --- /dev/null +++ b/.woodpecker/pre-commit.yaml @@ -0,0 +1,18 @@ +when: + - event: pull_request + +steps: + - name: pre-commit + image: git.unkin.net/unkin/almalinux9-gobuilder:20260606 + commands: + - uvx pre-commit run --all-files + backend_options: + kubernetes: + serviceAccountName: default + resources: + requests: + memory: 512Mi + cpu: 1 + limits: + memory: 2Gi + cpu: 2 diff --git a/.woodpecker/docker.yaml b/.woodpecker/release.yaml similarity index 100% rename from .woodpecker/docker.yaml rename to .woodpecker/release.yaml diff --git a/.woodpecker/test.yaml b/.woodpecker/test.yaml new file mode 100644 index 0000000..5884a7a --- /dev/null +++ b/.woodpecker/test.yaml @@ -0,0 +1,20 @@ +when: + - event: pull_request + +steps: + - name: test + image: golang:1.25 + commands: + - go vet ./... + - test -z "$(gofmt -l .)" + - go test -v -race ./... + backend_options: + kubernetes: + serviceAccountName: default + resources: + requests: + memory: 512Mi + cpu: 1 + limits: + memory: 2Gi + cpu: 2