Files
lmnp-organizer/.gitlab-ci.yml
T
nessar 878da155bd chore: add husky pre-commit hook and lint-staged configuration
- Created a pre-commit hook in .husky to run lint-staged.
- Added .lintstagedrc.mjs to format frontend files with Prettier and apply Spotless to backend Java files.
- Introduced .prettierignore to exclude specific directories from formatting.
2026-08-17 14:18:16 +02:00

80 lines
2.1 KiB
YAML

stages:
- test
- publish
workflow:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_COMMIT_TAG'
- if: '$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS && $CI_PIPELINE_SOURCE == "push"'
when: never
- if: '$CI_COMMIT_BRANCH'
backend-test:
stage: test
image: maven:3.9-eclipse-temurin-25-alpine
interruptible: true
script:
- cd backend
- mvn clean verify
frontend-test:
stage: test
image: node:26-alpine
interruptible: true
script:
- npm install -g bun
- cd frontend
- bun install --frozen-lockfile
- bun run lint
- bun run typecheck
- bun run test --coverage --watch=false
frontend-e2e:
stage: test
image: mcr.microsoft.com/playwright:v1.61.1-noble
interruptible: true
script:
- npm install -g bun
- cd frontend
- bun install --frozen-lockfile
- bun run e2e
.publish-image:
stage: publish
image: quay.io/buildah/stable:latest
variables:
STORAGE_DRIVER: vfs
BUILDAH_FORMAT: docker
before_script:
- echo "$CI_REGISTRY_PASSWORD" | buildah login --username "$CI_REGISTRY_USER" --password-stdin "$CI_REGISTRY"
script:
- |
if [ -n "$CI_COMMIT_TAG" ]; then
IMAGE_TAG="$CI_COMMIT_REF_SLUG"
else
IMAGE_TAG="latest"
fi
buildah build \
--pull-always \
--tag "$IMAGE_NAME:$CI_COMMIT_SHA" \
--tag "$IMAGE_NAME:$IMAGE_TAG" \
"$BUILD_CONTEXT"
buildah push "$IMAGE_NAME:$CI_COMMIT_SHA"
buildah push "$IMAGE_NAME:$IMAGE_TAG"
rules:
- if: '$CI_COMMIT_TAG'
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
publish-backend-image:
extends: .publish-image
variables:
IMAGE_NAME: '$CI_REGISTRY_IMAGE/backend'
BUILD_CONTEXT: backend
publish-frontend-image:
extends: .publish-image
variables:
IMAGE_NAME: '$CI_REGISTRY_IMAGE/frontend'
BUILD_CONTEXT: frontend