mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 03:17:33 +00:00
quality
This commit is contained in:
14
.github/workflows/test.yml
vendored
14
.github/workflows/test.yml
vendored
@@ -31,15 +31,11 @@ jobs:
|
|||||||
type=semver,pattern={{major}}.{{minor}}
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
type=semver,pattern={{major}}
|
type=semver,pattern={{major}}
|
||||||
- uses: depot/setup-action@v1
|
- uses: depot/setup-action@v1
|
||||||
- uses: depot/bake-action@v1
|
|
||||||
with:
|
with:
|
||||||
project: jp837jn3fm
|
oidc: true
|
||||||
push: false
|
- run: make login-quality-ci
|
||||||
targets: login-lint,login-test-unit,login-test-integration,login-test-acceptance
|
|
||||||
files: |
|
|
||||||
docker-bake.hcl
|
|
||||||
docker-bake-ci.hcl
|
|
||||||
env:
|
env:
|
||||||
# latest if branch is main, otherwise image version which is the pull request number
|
# latest if branch is main, otherwise image version which is the pull request number
|
||||||
BUILD_CACHE_KEY: ${{ github.ref == 'refs/heads/main' && 'latest' || fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
|
BUILDX_CLI: depot
|
||||||
- run: make login-quality
|
DEPOT_PROJECT_ID: jp837jn3fm
|
||||||
|
REF_TAG: ${{ github.ref == 'refs/heads/main' && 'latest' || fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
|
||||||
|
55
Makefile
55
Makefile
@@ -1,21 +1,23 @@
|
|||||||
XDG_CACHE_HOME ?= $(HOME)/.cache
|
XDG_CACHE_HOME ?= $(HOME)/.cache
|
||||||
export CACHE_DIR ?= $(XDG_CACHE_HOME)/zitadel-make
|
export CACHE_DIR ?= $(XDG_CACHE_HOME)/zitadel-make
|
||||||
|
|
||||||
export LOGIN_TAG ?= login:local
|
export BUILDX_CLI ?= docker buildx
|
||||||
export LOGIN_TEST_UNIT_TAG := login-test-unit:local
|
export REF_TAG ?= local
|
||||||
export LOGIN_TEST_INTEGRATION_TAG ?= login-test-integration:local
|
export LOGIN_TAG := login:${REF_TAG}
|
||||||
export LOGIN_TEST_ACCEPTANCE_TAG := login-test-acceptance:local
|
export LOGIN_TEST_UNIT_TAG := login-test-unit:${REF_TAG}
|
||||||
export LOGIN_TEST_ACCEPTANCE_SETUP_TAG := login-test-acceptance-setup:local
|
export LOGIN_TEST_INTEGRATION_TAG ?= login-test-integration:${REF_TAG}
|
||||||
export LOGIN_TEST_ACCEPTANCE_SINK_TAG := login-test-acceptance-sink:local
|
export LOGIN_TEST_ACCEPTANCE_TAG := login-test-acceptance:${REF_TAG}
|
||||||
export LOGIN_TEST_ACCEPTANCE_OIDCRP_TAG := login-test-acceptance-oidcrp:local
|
export LOGIN_TEST_ACCEPTANCE_SETUP_TAG := login-test-acceptance-setup:${REF_TAG}
|
||||||
export LOGIN_TEST_ACCEPTANCE_OIDCOP_TAG := login-test-acceptance-oidcop:local
|
export LOGIN_TEST_ACCEPTANCE_SINK_TAG := login-test-acceptance-sink:${REF_TAG}
|
||||||
export LOGIN_TEST_ACCEPTANCE_SAMLSP_TAG := login-test-acceptance-samlsp:local
|
export LOGIN_TEST_ACCEPTANCE_OIDCRP_TAG := login-test-acceptance-oidcrp:${REF_TAG}
|
||||||
export LOGIN_TEST_ACCEPTANCE_SAMLIDP_TAG := login-test-acceptance-samlidp:local
|
export LOGIN_TEST_ACCEPTANCE_OIDCOP_TAG := login-test-acceptance-oidcop:${REF_TAG}
|
||||||
|
export LOGIN_TEST_ACCEPTANCE_SAMLSP_TAG := login-test-acceptance-samlsp:${REF_TAG}
|
||||||
|
export LOGIN_TEST_ACCEPTANCE_SAMLIDP_TAG := login-test-acceptance-samlidp:${REF_TAG}
|
||||||
export POSTGRES_TAG := postgres:17.0-alpine3.19
|
export POSTGRES_TAG := postgres:17.0-alpine3.19
|
||||||
export GOLANG_TAG := golang:1.24-alpine
|
export GOLANG_TAG := golang:1.24-alpine
|
||||||
# TODO: use ghcr.io/zitadel/zitadel:latest
|
# TODO: use ghcr.io/zitadel/zitadel:latest
|
||||||
export ZITADEL_TAG ?= ghcr.io/zitadel/zitadel:02617cf17fdde849378c1a6b5254bbfb2745b164
|
export ZITADEL_TAG ?= ghcr.io/zitadel/zitadel:02617cf17fdde849378c1a6b5254bbfb2745b164
|
||||||
export CORE_MOCK_TAG := core-mock:local
|
export CORE_MOCK_TAG := core-mock:${REF_TAG}
|
||||||
|
|
||||||
.PHONY: login-help
|
.PHONY: login-help
|
||||||
login-help:
|
login-help:
|
||||||
@@ -31,30 +33,14 @@ login-help:
|
|||||||
@echo " show-cache-keys - Show all cache keys with image ids and exit codes."
|
@echo " show-cache-keys - Show all cache keys with image ids and exit codes."
|
||||||
@echo " clean-cache-keys - Remove all cache keys."
|
@echo " clean-cache-keys - Remove all cache keys."
|
||||||
|
|
||||||
login-lint-build:
|
login-lint:
|
||||||
docker buildx bake login-lint
|
$(BUILDX_CLI) bake login-lint
|
||||||
|
|
||||||
login-lint-run:
|
login-test-unit:
|
||||||
docker run --rm $(LOGIN_LINT_TAG) lint
|
$(BUILDX_CLI) bake login-test-unit
|
||||||
docker run --rm $(LOGIN_LINT_TAG) format --check
|
|
||||||
|
|
||||||
.PHONY: login-lint
|
|
||||||
login-lint: login-lint-build
|
|
||||||
# ./scripts/run_or_skip.sh login-lint-run $(LOGIN_LINT_TAG)
|
|
||||||
|
|
||||||
login-test-unit-build:
|
|
||||||
docker buildx bake login-test-unit
|
|
||||||
|
|
||||||
login-test-unit-run:
|
|
||||||
docker run --rm $(LOGIN_TEST_UNIT_TAG) test:unit:standalone
|
|
||||||
|
|
||||||
.PHONY: login-test-unit
|
|
||||||
login-test-unit: login-test-unit-build
|
|
||||||
./scripts/run_or_skip.sh login-test-unit-run $(LOGIN_TEST_UNIT_TAG)
|
|
||||||
|
|
||||||
login-test-integration-build:
|
login-test-integration-build:
|
||||||
docker buildx bake core-mock
|
$(BUILDX_CLI) bake core-mock login-test-integration
|
||||||
docker buildx bake login-test-integration
|
|
||||||
|
|
||||||
login-test-integration-run: login-test-integration-cleanup
|
login-test-integration-run: login-test-integration-cleanup
|
||||||
docker compose --file ./apps/login-test-integration/docker-compose.yaml run --rm integration
|
docker compose --file ./apps/login-test-integration/docker-compose.yaml run --rm integration
|
||||||
@@ -71,8 +57,7 @@ login-test-integration: login-standalone-build login-test-integration-build
|
|||||||
|
|
||||||
login-test-acceptance-build:
|
login-test-acceptance-build:
|
||||||
COMPOSE_BAKE=true docker compose --file ./apps/login-test-acceptance/docker-compose.yaml build
|
COMPOSE_BAKE=true docker compose --file ./apps/login-test-acceptance/docker-compose.yaml build
|
||||||
docker buildx bake login-standalone
|
$(BUILDX_CLI) bake login-standalone login-test-acceptance
|
||||||
docker buildx bake login-test-acceptance
|
|
||||||
|
|
||||||
login-test-acceptance-run: login-acceptance-cleanup
|
login-test-acceptance-run: login-acceptance-cleanup
|
||||||
docker compose --file ./apps/login-test-acceptance/docker-compose.yaml run --rm --service-ports acceptance
|
docker compose --file ./apps/login-test-acceptance/docker-compose.yaml run --rm --service-ports acceptance
|
||||||
@@ -100,7 +85,7 @@ login-quality: login-lint login-test-unit login-test-integration login-test-acce
|
|||||||
|
|
||||||
.PHONY: login-standalone-build
|
.PHONY: login-standalone-build
|
||||||
login-standalone-build:
|
login-standalone-build:
|
||||||
docker buildx bake login-standalone
|
$(BUILDX_CLI) bake login-standalone
|
||||||
|
|
||||||
.PHONY: clean-cache-keys
|
.PHONY: clean-cache-keys
|
||||||
clean-cache-keys:
|
clean-cache-keys:
|
||||||
|
@@ -4,13 +4,13 @@ variable "IMAGE_REGISTRY" {
|
|||||||
default = "ghcr.io/zitadel"
|
default = "ghcr.io/zitadel"
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "BUILD_CACHE_KEY" {
|
variable "REF_TAG" {
|
||||||
default = "local"
|
default = "local"
|
||||||
}
|
}
|
||||||
|
|
||||||
target "login-pnpm" {
|
target "login-pnpm" {
|
||||||
cache-from = [
|
cache-from = [
|
||||||
{ "type": "registry", "ref": "${IMAGE_REGISTRY}/login-pnpm-buildcache:${BUILD_CACHE_KEY}" },
|
{ "type": "registry", "ref": "${IMAGE_REGISTRY}/login-pnpm-buildcache:${REF_TAG}" },
|
||||||
{ "type": "registry", "ref": "${IMAGE_REGISTRY}/login-pnpm-buildcache:latest" },
|
{ "type": "registry", "ref": "${IMAGE_REGISTRY}/login-pnpm-buildcache:latest" },
|
||||||
]
|
]
|
||||||
dockerfile = "dockerfiles/login-pnpm.Dockerfile"
|
dockerfile = "dockerfiles/login-pnpm.Dockerfile"
|
||||||
@@ -18,7 +18,7 @@ target "login-pnpm" {
|
|||||||
|
|
||||||
target "login-dev-base" {
|
target "login-dev-base" {
|
||||||
cache-from = [
|
cache-from = [
|
||||||
{"type": "registry", "ref": "${IMAGE_REGISTRY}/login-dev-base-buildcache:${BUILD_CACHE_KEY}"},
|
{"type": "registry", "ref": "${IMAGE_REGISTRY}/login-dev-base-buildcache:${REF_TAG}"},
|
||||||
{"type": "registry", "ref": "${IMAGE_REGISTRY}/login-dev-base-buildcache:latest"},
|
{"type": "registry", "ref": "${IMAGE_REGISTRY}/login-dev-base-buildcache:latest"},
|
||||||
]
|
]
|
||||||
dockerfile = "dockerfiles/login-dev-base.Dockerfile"
|
dockerfile = "dockerfiles/login-dev-base.Dockerfile"
|
||||||
@@ -29,7 +29,7 @@ target "login-dev-base" {
|
|||||||
|
|
||||||
target "login-lint" {
|
target "login-lint" {
|
||||||
cache-from = [
|
cache-from = [
|
||||||
{"type": "registry", "ref": "${IMAGE_REGISTRY}/login-lint-buildcache:${BUILD_CACHE_KEY}"},
|
{"type": "registry", "ref": "${IMAGE_REGISTRY}/login-lint-buildcache:${REF_TAG}"},
|
||||||
{"type": "registry", "ref": "${IMAGE_REGISTRY}/login-lint-buildcache:latest"},
|
{"type": "registry", "ref": "${IMAGE_REGISTRY}/login-lint-buildcache:latest"},
|
||||||
]
|
]
|
||||||
dockerfile = "dockerfiles/login-lint.Dockerfile"
|
dockerfile = "dockerfiles/login-lint.Dockerfile"
|
||||||
@@ -40,7 +40,7 @@ target "login-lint" {
|
|||||||
|
|
||||||
target "login-test-unit" {
|
target "login-test-unit" {
|
||||||
cache-from = [
|
cache-from = [
|
||||||
{"type": "registry", "ref": "${IMAGE_REGISTRY}/login-test-unit-buildcache:${BUILD_CACHE_KEY}"},
|
{"type": "registry", "ref": "${IMAGE_REGISTRY}/login-test-unit-buildcache:${REF_TAG}"},
|
||||||
{"type": "registry", "ref": "${IMAGE_REGISTRY}/login-test-unit-buildcache:latest"},
|
{"type": "registry", "ref": "${IMAGE_REGISTRY}/login-test-unit-buildcache:latest"},
|
||||||
]
|
]
|
||||||
dockerfile = "dockerfiles/login-test-unit.Dockerfile"
|
dockerfile = "dockerfiles/login-test-unit.Dockerfile"
|
||||||
@@ -51,7 +51,7 @@ target "login-test-unit" {
|
|||||||
|
|
||||||
target "login-client" {
|
target "login-client" {
|
||||||
cache-from = [
|
cache-from = [
|
||||||
{"type": "registry", "ref": "${IMAGE_REGISTRY}/login-client-buildcache:${BUILD_CACHE_KEY}"},
|
{"type": "registry", "ref": "${IMAGE_REGISTRY}/login-client-buildcache:${REF_TAG}"},
|
||||||
{"type": "registry", "ref": "${IMAGE_REGISTRY}/login-client-buildcache:latest"},
|
{"type": "registry", "ref": "${IMAGE_REGISTRY}/login-client-buildcache:latest"},
|
||||||
]
|
]
|
||||||
dockerfile = "dockerfiles/login-client.Dockerfile"
|
dockerfile = "dockerfiles/login-client.Dockerfile"
|
||||||
@@ -97,7 +97,7 @@ variable "LOGIN_TEST_INTEGRATION_TAG" {
|
|||||||
|
|
||||||
target "login-test-integration" {
|
target "login-test-integration" {
|
||||||
cache-from = [
|
cache-from = [
|
||||||
{"type": "registry", "ref": "${IMAGE_REGISTRY}/login-test-integration-buildcache:${BUILD_CACHE_KEY}"},
|
{"type": "registry", "ref": "${IMAGE_REGISTRY}/login-test-integration-buildcache:${REF_TAG}"},
|
||||||
{"type": "registry", "ref": "${IMAGE_REGISTRY}/login-test-integration-buildcache:latest"},
|
{"type": "registry", "ref": "${IMAGE_REGISTRY}/login-test-integration-buildcache:latest"},
|
||||||
]
|
]
|
||||||
dockerfile = "dockerfiles/login-test-integration.Dockerfile"
|
dockerfile = "dockerfiles/login-test-integration.Dockerfile"
|
||||||
@@ -114,7 +114,7 @@ variable "LOGIN_TEST_ACCEPTANCE_TAG" {
|
|||||||
|
|
||||||
target "login-test-acceptance" {
|
target "login-test-acceptance" {
|
||||||
cache-from = [
|
cache-from = [
|
||||||
{"type": "registry", "ref": "${IMAGE_REGISTRY}/login-test-acceptance-buildcache:${BUILD_CACHE_KEY}"},
|
{"type": "registry", "ref": "${IMAGE_REGISTRY}/login-test-acceptance-buildcache:${REF_TAG}"},
|
||||||
{"type": "registry", "ref": "${IMAGE_REGISTRY}/login-test-acceptance-buildcache:latest"},
|
{"type": "registry", "ref": "${IMAGE_REGISTRY}/login-test-acceptance-buildcache:latest"},
|
||||||
]
|
]
|
||||||
dockerfile = "dockerfiles/login-test-acceptance.Dockerfile"
|
dockerfile = "dockerfiles/login-test-acceptance.Dockerfile"
|
||||||
@@ -132,7 +132,7 @@ variable "LOGIN_TAG" {
|
|||||||
# We run integration and acceptance tests against the next standalone server for docker.
|
# We run integration and acceptance tests against the next standalone server for docker.
|
||||||
target "login-standalone" {
|
target "login-standalone" {
|
||||||
cache-from = [
|
cache-from = [
|
||||||
{"type": "registry", "ref": "${IMAGE_REGISTRY}/login-buildcache:${BUILD_CACHE_KEY}"},
|
{"type": "registry", "ref": "${IMAGE_REGISTRY}/login-buildcache:${REF_TAG}"},
|
||||||
{"type": "registry", "ref": "${IMAGE_REGISTRY}/login-buildcache:latest"},
|
{"type": "registry", "ref": "${IMAGE_REGISTRY}/login-buildcache:latest"},
|
||||||
]
|
]
|
||||||
dockerfile = "dockerfiles/login-standalone.Dockerfile"
|
dockerfile = "dockerfiles/login-standalone.Dockerfile"
|
||||||
|
@@ -3,3 +3,4 @@ COPY apps/login/package.json ./apps/login/
|
|||||||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
|
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
|
||||||
pnpm install --frozen-lockfile --workspace-root --filter zitadel-client
|
pnpm install --frozen-lockfile --workspace-root --filter zitadel-client
|
||||||
COPY apps/login ./apps/login
|
COPY apps/login ./apps/login
|
||||||
|
RUN pnpm test:unit:standalone
|
||||||
|
Reference in New Issue
Block a user