This commit is contained in:
Florian Forster 2025-02-19 12:02:42 +01:00
parent ac281cc3c1
commit 18a1e89dab
No known key found for this signature in database
3 changed files with 12 additions and 3 deletions

View File

@ -20,4 +20,8 @@ jobs:
source: . source: .
push: false push: false
targets: build targets: build
load: true - uses: docker/bake-action@v6
with:
source: .
push: false
targets: lint

View File

@ -24,7 +24,8 @@ RUN make core_lint
FROM scratch AS output FROM scratch AS output
COPY --from=build /app/zitadel . COPY --from=build /app/zitadel .
FROM base AS unit-test FROM base AS unit
COPY .git/ .git/
RUN make core_unit_test RUN make core_unit_test
FROM debian:latest AS base-image FROM debian:latest AS base-image

View File

@ -81,30 +81,34 @@ target "core" {
name = "core-${tgt}" name = "core-${tgt}"
inherits = ["_core"] inherits = ["_core"]
matrix = { matrix = {
tgt = ["build", "output", "lint", "image"] tgt = ["build", "output", "lint", "image", "unit"]
} }
output = { output = {
"build" = ["type=cacheonly"] "build" = ["type=cacheonly"]
"output" = ["type=local,dest=.build/core"] "output" = ["type=local,dest=.build/core"]
"lint" = ["type=cacheonly"] "lint" = ["type=cacheonly"]
"unit" = ["type=cacheonly"]
"image" = ["type=docker"] "image" = ["type=docker"]
}[tgt] }[tgt]
tags = { tags = {
"build" = [] "build" = []
"output" = [] "output" = []
"lint" = [] "lint" = []
"unit" = []
"image" = ["${REGISTRY}/zitadel:${GITHUB_SHA}"] "image" = ["${REGISTRY}/zitadel:${GITHUB_SHA}"]
}[tgt] }[tgt]
cache-to = { cache-to = {
"build" = ["type=gha,ignore-error=true,mode=max,scope=core-${tgt}"] "build" = ["type=gha,ignore-error=true,mode=max,scope=core-${tgt}"]
"output" = ["type=gha,ignore-error=true,mode=max,scope=core-${tgt}"] "output" = ["type=gha,ignore-error=true,mode=max,scope=core-${tgt}"]
"lint" = ["type=gha,ignore-error=true,mode=max,scope=core-${tgt}"] "lint" = ["type=gha,ignore-error=true,mode=max,scope=core-${tgt}"]
"unit" = ["type=gha,ignore-error=true,mode=max,scope=core-${tgt}"]
"image" = ["type=gha,ignore-error=true,mode=max,scope=core-${tgt}"] "image" = ["type=gha,ignore-error=true,mode=max,scope=core-${tgt}"]
}[tgt] }[tgt]
cache-from = { cache-from = {
"build" = ["type=gha,scope=core-${tgt}"] "build" = ["type=gha,scope=core-${tgt}"]
"output" = ["type=gha,scope=core-${tgt}"] "output" = ["type=gha,scope=core-${tgt}"]
"lint" = ["type=gha,scope=core-${tgt}"] "lint" = ["type=gha,scope=core-${tgt}"]
"unit" = ["type=gha,scope=core-${tgt}"]
"image" = ["type=gha,scope=core-${tgt}"] "image" = ["type=gha,scope=core-${tgt}"]
}[tgt] }[tgt]
target = tgt target = tgt