fix(pipeline): Add frontend back, add testcontainers back

This commit is contained in:
2025-11-20 16:07:30 +01:00
parent cf2481e6c8
commit 27a2c99ef8

View File

@@ -18,101 +18,101 @@ on:
- '.gitea/workflows/pipeline.yaml' - '.gitea/workflows/pipeline.yaml'
jobs: jobs:
# frontend: frontend:
# runs-on: ubuntu-latest runs-on: ubuntu-latest
# defaults: defaults:
# run: run:
# working-directory: ./legalconsenthub working-directory: ./legalconsenthub
#
# steps: steps:
# - name: Checkout code - name: Checkout code
# uses: actions/checkout@v4 uses: actions/checkout@v4
#
# - name: Setup Node.js - name: Setup Node.js
# uses: actions/setup-node@v4 uses: actions/setup-node@v4
# with: with:
# node-version: '22.16.0' node-version: '22.16.0'
#
# - name: Setup Java - name: Setup Java
# uses: actions/setup-java@v4 uses: actions/setup-java@v4
# with: with:
# distribution: 'temurin' distribution: 'temurin'
# java-version: '21' java-version: '21'
#
# - name: Setup pnpm - name: Setup pnpm
# uses: pnpm/action-setup@v4 uses: pnpm/action-setup@v4
# with: with:
# version: 10.13.1 version: 10.13.1
# run_install: false run_install: false
#
# - name: Get pnpm store directory - name: Get pnpm store directory
# id: pnpm-cache id: pnpm-cache
# run: | run: |
# echo "STORE_PATH=$(pnpm store path)" >> $GITEA_OUTPUT echo "STORE_PATH=$(pnpm store path)" >> $GITEA_OUTPUT
#
# - name: Setup pnpm cache - name: Setup pnpm cache
# uses: actions/cache@v4 uses: actions/cache@v4
# with: with:
# path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
# key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
# restore-keys: | restore-keys: |
# ${{ runner.os }}-pnpm-store- ${{ runner.os }}-pnpm-store-
#
# - name: Install dependencies - name: Install dependencies
# run: pnpm install --frozen-lockfile run: pnpm install --frozen-lockfile
#
# - name: Build application - name: Build application
# run: pnpm build run: pnpm build
#
# - name: Run linting - name: Run linting
# run: pnpm lint run: pnpm lint
#
# - name: Run type checking - name: Run type checking
# run: pnpm type-check run: pnpm type-check
#
# - name: Set up Docker Buildx - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
#
# - name: Log in to Gitea Container Registry - name: Log in to Gitea Container Registry
# if: gitea.event_name == 'push' && gitea.ref == 'refs/heads/main' if: gitea.event_name == 'push' && gitea.ref == 'refs/heads/main'
# uses: docker/login-action@v3 uses: docker/login-action@v3
# with: with:
# registry: gitea.lugnas.de registry: gitea.lugnas.de
# username: ${{ gitea.actor }} username: ${{ gitea.actor }}
# password: ${{ secrets.DOCKER_PUSH_TOKEN }} password: ${{ secrets.DOCKER_PUSH_TOKEN }}
#
# - name: Extract metadata for Docker - name: Extract metadata for Docker
# id: meta id: meta
# uses: docker/metadata-action@v5 uses: docker/metadata-action@v5
# with: with:
# images: gitea.lugnas.de/${{ gitea.repository_owner }}/legalconsenthub images: gitea.lugnas.de/${{ gitea.repository_owner }}/legalconsenthub
# tags: | tags: |
# type=raw,value=latest,enable=${{ gitea.ref == 'refs/heads/main' }} type=raw,value=latest,enable=${{ gitea.ref == 'refs/heads/main' }}
# type=sha,prefix=,format=long type=sha,prefix=,format=long
#
# - name: Build and push Docker image - name: Build and push Docker image
# uses: docker/build-push-action@v5 uses: docker/build-push-action@v5
# with: with:
# context: . context: .
# file: ./legalconsenthub/Dockerfile file: ./legalconsenthub/Dockerfile
# push: ${{ gitea.event_name == 'push' && gitea.ref == 'refs/heads/main' }} push: ${{ gitea.event_name == 'push' && gitea.ref == 'refs/heads/main' }}
# platforms: linux/amd64 platforms: linux/amd64
# tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
# labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
# cache-from: type=local,src=/tmp/.buildx-cache cache-from: type=local,src=/tmp/.buildx-cache
# cache-to: type=local,dest=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache
#
# - name: Image built successfully - name: Image built successfully
# if: gitea.event_name == 'push' && gitea.ref == 'refs/heads/main' if: gitea.event_name == 'push' && gitea.ref == 'refs/heads/main'
# run: | run: |
# echo "✅ Docker image built and pushed successfully" echo "✅ Docker image built and pushed successfully"
# echo "📦 Image: gitea.lugnas.de/${{ gitea.repository_owner }}/legalconsenthub:latest" echo "📦 Image: gitea.lugnas.de/${{ gitea.repository_owner }}/legalconsenthub:latest"
# echo "📦 Image: gitea.lugnas.de/${{ gitea.repository_owner }}/legalconsenthub:${{ gitea.sha }}" echo "📦 Image: gitea.lugnas.de/${{ gitea.repository_owner }}/legalconsenthub:${{ gitea.sha }}"
#
# - name: Dry-run completed - name: Dry-run completed
# if: gitea.event_name == 'pull_request' if: gitea.event_name == 'pull_request'
# run: | run: |
# echo "✅ Dry-run build completed successfully (image not pushed)" echo "✅ Dry-run build completed successfully (image not pushed)"
backend: backend:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -121,21 +121,6 @@ jobs:
run: run:
working-directory: ./legalconsenthub-backend working-directory: ./legalconsenthub-backend
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_DB: legalconsenthub_test
POSTGRES_USER: test
POSTGRES_PASSWORD: test
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U test"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
@@ -150,7 +135,7 @@ jobs:
uses: gradle/actions/setup-gradle@v3 uses: gradle/actions/setup-gradle@v3
- name: Build application - name: Build application
run: ./gradlew build --debug -x test run: ./gradlew build -x test
- name: Run ktlint check - name: Run ktlint check
run: ./gradlew ktlintCheck run: ./gradlew ktlintCheck
@@ -158,10 +143,7 @@ jobs:
- name: Run tests - name: Run tests
run: ./gradlew test run: ./gradlew test
env: env:
SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/legalconsenthub_test SPRING_PROFILES_ACTIVE: testcontainers
SPRING_DATASOURCE_USERNAME: test
SPRING_DATASOURCE_PASSWORD: test
SPRING_JPA_HIBERNATE_DDL_AUTO: create-drop
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3