This commit is contained in:
Florian Forster 2025-02-25 21:59:28 +01:00
parent 26db6e138a
commit f107a7bbb8
No known key found for this signature in database
5 changed files with 48 additions and 15 deletions

View File

@ -9,7 +9,7 @@
},
"customizations": {
"vscode": {
"extensions": ["golang.go"]
"extensions": ["golang.go", "hashicorp.hcl", "zxh404.vscode-proto3"]
}
},
"forwardPorts": [

View File

@ -22,7 +22,7 @@ jobs:
with:
source: .
push: false
targets: build
targets: ci
no-cache: false
load: false
- run: ls -latr .build

View File

@ -36,14 +36,14 @@ ARG ARCH=
COPY --from=builder /app/zitadel-${OS}-${ARCH} zitadel-${OS}-${ARCH}
FROM base AS lint
COPY --from=console ./ internal/api/ui/console/static
#COPY --from=console ./ internal/api/ui/console/static
COPY .golangci.yaml ./
COPY .git/ ./.git/
RUN golangci-lint run \
--timeout 10m \
--config ./.golangci.yaml \
--out-format=github-actions \
--concurrency=$$(getconf _NPROCESSORS_ONLN)
--concurrency=$(getconf _NPROCESSORS_ONLN)
FROM base AS unit-test
COPY --from=console ./ internal/api/ui/console/static

View File

@ -2,4 +2,10 @@ generate:
docker buildx bake generate
build:
docker buildx bake build
docker buildx bake build
lint:
docker buildx bake lint
unit:
docker buildx bake unit

View File

@ -6,30 +6,30 @@ variable "REGISTRY" {
default = "ghcr.io/zitadel"
}
group "all" {
targets = ["build", "lint", "image", "unit"]
}
group "build" {
targets = ["console-build", "core-build"]
group "ci" {
targets = ["build", "lint", "unit"]
}
group "generate" {
targets = ["console-generate" , "core-generate"]
}
group "build" {
targets = ["console-build", "core-build"]
}
group "lint" {
targets = ["console-lint", "core-lint"]
}
group "image" {
targets = ["console-image", "core-image"]
}
group "unit" {
targets = ["core-unit"]
}
group "image" {
targets = ["console-image", "core-image"]
}
target "devcontainer" {
dockerfile = "Dockerfile.devcontainer"
context = "."
@ -62,6 +62,14 @@ target "console-build" {
cache-from = ["type=gha,scope=console-build"]
}
target "console-lint" {
inherits = ["_console"]
output = ["type=cacheonly"]
target = "lint"
cache-to = ["type=gha,ignore-error=true,mode=max,scope=console-lint"]
cache-from = ["type=gha,scope=console-lint"]
}
target "_core" {
dockerfile = "Dockerfile.core"
context = "."
@ -96,4 +104,23 @@ target "core-build" {
target = "build"
cache-to = ["type=gha,ignore-error=true,mode=max,scope=core-build"]
cache-from = ["type=gha,scope=core-build"]
}
target "core-lint" {
inherits = ["_core"]
output = ["type=cacheonly"]
target = "lint"
cache-to = ["type=gha,ignore-error=true,mode=max,scope=core-lint"]
cache-from = ["type=gha,scope=core-lint"]
}
target "core-unit" {
inherits = ["_core"]
output = ["type=local,dest=.build/core"]
contexts = {
console = "target:console-build"
}
target = "unit"
cache-to = ["type=gha,ignore-error=true,mode=max,scope=core-unit"]
cache-from = ["type=gha,scope=core-unit"]
}