Replace Jenkinsfile with GitHub Actions CI, release and lint tooling

This commit is contained in:
2026-10-20 20:47:44 +00:00
parent 222877a847
commit 74f0a2f5ab
15 changed files with 337 additions and 122 deletions
+30
View File
@@ -0,0 +1,30 @@
#!/bin/sh
set -e
go mod tidy -diff
files=$(git diff --cached --name-only --diff-filter=ACM -- '*.go')
[ -n "$files" ] || exit 0
pkgs=$(echo "$files" | xargs -n1 dirname | sort -u | sed 's|^|./|')
unformatted=$(gofmt -l $files)
if [ -n "$unformatted" ]; then
echo "gofmt: $unformatted" >&2
exit 1
fi
# The program is Linux-only (netlink), so everything is checked for Linux.
export GOOS=linux
go vet $pkgs
# Test binaries only run on a Linux host; elsewhere they are compiled, not run.
if [ "$(go env GOHOSTOS)" = linux ]; then
go test -race $pkgs
else
go test -exec /usr/bin/true $pkgs
fi
if command -v golangci-lint >/dev/null; then
golangci-lint run $pkgs
fi