Migrate to bkit, add linting

This commit is contained in:
2025-06-02 21:01:01 +03:00
parent b1c34f77ce
commit 984b5bbee9
5 changed files with 35 additions and 6 deletions
+4
View File
@@ -0,0 +1,4 @@
version: "2"
run:
timeout: 5m
+1 -1
View File
@@ -1,4 +1,4 @@
local project = import 'brewkit/project.libsonnet';
local project = import 'bkit/project.libsonnet';
local appIDs = [
"anon3anon",
+4
View File
@@ -0,0 +1,4 @@
{
gobuilder: "golang:1.24-alpine",
golangcilint: "golangci/golangci-lint:v2.1-alpine",
}
@@ -18,10 +18,10 @@ local gocache = [
{
project(appIDs):: {
apiVersion: "brewkit/v1",
apiVersion: "bkit/v1",
targets: {
all: ["modules", "build"],
all: ["modules", "build", "check"],
} + {
modules: ["gotidy", "modulesvendor"],
@@ -62,6 +62,30 @@ local gocache = [
}
}
for appID in appIDs
} + {
check: ["test", "lint"],
test: {
from: "gobase",
workdir: "/app",
cache: gocache,
command: "go test ./..."
},
lint: {
from: images.golangcilint,
workdir: "/app",
cache: gocache,
copy: [
copyFrom("gosources", "/app", "/app"),
copy(".golangci.yml", ".golangci.yml"),
],
env: {
GOCACHE: "/app/cache/go-build",
GOLANGCI_LINT_CACHE: "/app/cache/go-build",
},
command: "golangci-lint run"
},
} + {
gobase: {
from: images.gobuilder,
-3
View File
@@ -1,3 +0,0 @@
{
gobuilder: "golang:1.24.2"
}