--- /dev/null
+golang:
+ image: golang:1.23-bookworm
+ script:
+ - ./ci/run
+
+golang-debian-stable:
+ image: golang:1.19-bookworm
+ script:
+ # Only check building as not all additonal checks work with the old golang
+ # version.
+ - go build
--- /dev/null
+linters:
+ disable-all: true
+ enable:
+ # Enabled by default
+ - errcheck
+ - gosimple
+ - govet
+ - ineffassign
+ - staticcheck
+ - unused
+ # Additional checks
+ - bodyclose
+ - contextcheck
+ - copyloopvar
+ - durationcheck
+ - errname
+ - exhaustive
+ - exportloopref
+ - gofmt
+ - nilerr
+ - nolintlint
+ - predeclared
+ - rowserrcheck
+ - typecheck
+ - unconvert
+ - wastedassign
+
+ issues:
+ # Don't hide potential important issues
+ exclude-use-default: false
+
+linters-settings:
+ exhaustive:
+ # "default" is good enough to be exhaustive
+ default-signifies-exhaustive: true
--- /dev/null
+#!/bin/sh
+
+# SPDX-License-Identifier: GPL-3.0-or-later
+# Copyright (C) 2024 Simon Ruderich
+
+set -eu
+set -x
+
+
+# Go
+
+PATH=$HOME/go/bin:$PATH
+export PATH
+
+make
+
+# Additional static checks only run in CI
+go install golang.org/x/vuln/cmd/govulncheck@latest
+govulncheck ./...
+go install honnef.co/go/tools/cmd/staticcheck@v0.5.1
+staticcheck ./...
+go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.62.0
+golangci-lint run
+
+test -z "$(git clean -nd)" # any untracked files left?
+make clean
+test -z "$(git clean -ndx)" # any unignored files left?