Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/repair-hub-ui"
schedule:
interval: "weekly"
open-pull-requests-limit: 10

groups:
angular:
patterns:
- "@angular/*"
update-types:
- "minor"
- "patch"
tooling:
patterns:
- "@typescript-eslint/*"
- "typescript"
- "eslint*"
- "prettier"
update-types:
- "minor"
- "patch"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
65 changes: 65 additions & 0 deletions .github/workflows/api-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: api-ci

on:
pull_request:
paths:
- "repair-hub-api/**"
- ".github/workflows/api-ci.yml"
push:
branches: [ "main" ]
paths:
- "repair-hub-api/**"
- ".github/workflows/api-ci.yml"

concurrency:
group: api-ci-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
api:
runs-on: ubuntu-latest

services:
postgres:
image: postgres:17
env:
POSTGRES_DB: repairhub
POSTGRES_USER: repairhub
POSTGRES_PASSWORD: repairhub
ports:
- 5432:5432
options: >-
--health-cmd="pg_isready -U repairhub -d repairhub"
--health-interval=10s
--health-timeout=5s
--health-retries=10

env:
SPRING_PROFILES_ACTIVE: ci
SPRING_DATASOURCE_URL: jdbc:postgresql://localhost:5432/repairhub
SPRING_DATASOURCE_USERNAME: repairhub
SPRING_DATASOURCE_PASSWORD: repairhub

defaults:
run:
working-directory: repair-hub-api

steps:
- name: Checkout
uses: actions/checkout@v5

- name: Setup Java 25
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "25"
cache: gradle

- name: Grant execute permission for Gradle wrapper
run: chmod +x ./gradlew

- name: Build + tests
run: ./gradlew clean test
52 changes: 52 additions & 0 deletions .github/workflows/api-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build and Push API Image

on:
pull_request:
paths:
- "repair-hub-api/**"
- ".github/workflows/api-docker.yml"
push:
branches: [ main ]

permissions:
contents: read

jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ secrets.DOCKERHUB_USERNAME }}/repair-hub-api
tags: |
type=sha
type=raw,value=latest

- name: Build and push
uses: docker/build-push-action@v6
with:
context: ./repair-hub-api
file: ./repair-hub-api/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
31 changes: 31 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: codeql

on:
push:
branches: [ "main" ]
pull_request:
schedule:
- cron: "17 3 * * 1" # montags 03:17 UTC, weil warum nicht

permissions:
contents: read

jobs:
codeql-js:
name: CodeQL (JS/TS)
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write

steps:
- name: Checkout
uses: actions/checkout@v5

- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: javascript-typescript

- name: Analyze
uses: github/codeql-action/analyze@v4
17 changes: 17 additions & 0 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: dependency-review

on:
pull_request:

permissions:
contents: read

jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: Dependency Review
uses: actions/dependency-review-action@v4
with:
fail-on-severity: high
comment-summary-in-pr: never
51 changes: 51 additions & 0 deletions .github/workflows/ui-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: ui-ci

on:
pull_request:
paths:
- "repair-hub-ui/**"
- ".github/workflows/ui-ci.yml"
push:
branches: [ "main" ]
paths:
- "repair-hub-ui/**"
- ".github/workflows/ui-ci.yml"

concurrency:
group: ui-ci-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
ui:
runs-on: ubuntu-latest
defaults:
run:
working-directory: repair-hub-ui

steps:
- name: Checkout
uses: actions/checkout@v5

- name: Setup Node + npm cache
uses: actions/setup-node@v6
with:
node-version-file: repair-hub-ui/.nvmrc
cache: npm
cache-dependency-path: repair-hub-ui/package-lock.json

- name: Install dependencies
run: npm ci

- name: Lint
run: npm run lint --if-present

- name: Unit tests
env:
CI: "true"
run: npm test --if-present -- --watch=false

- name: Build
run: npm run build --if-present
52 changes: 52 additions & 0 deletions .github/workflows/ui-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build and Push UI Image

on:
pull_request:
paths:
- "repair-hub-ui/**"
- ".github/workflows/ui-docker.yml"
push:
branches: [ main ]

permissions:
contents: read

jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ secrets.DOCKERHUB_USERNAME }}/repair-hub-ui
tags: |
type=sha
type=raw,value=latest

- name: Build and push
uses: docker/build-push-action@v6
with:
context: ./repair-hub-ui
file: ./repair-hub-ui/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
25 changes: 25 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
###############################################################################
# OS / Editor junk
###############################################################################
.DS_Store
Thumbs.db
*.swp
*.swo
*~
###############################################################################
# IntelliJ IDEA
###############################################################################
.idea/
*.iml
*.iws
*.ipr
out/
# IntelliJ with Gradle
.gradle/
# IntelliJ misc
.ideaModules/
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
34 changes: 34 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
services:
postgres:
image: postgres:17.4
environment:
POSTGRES_DB: repairhub
POSTGRES_PASSWORD: secret
POSTGRES_USER: repairhub
ports:
- "5432:5432"
volumes:
- postgres-data:/var/lib/postgresql/data

api:
build:
context: ./repair-hub-api
environment:
SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/repairhub
SPRING_DATASOURCE_USERNAME: repairhub
SPRING_DATASOURCE_PASSWORD: secret
depends_on:
- postgres
ports:
- "8080:8080"

ui:
build:
context: ./repair-hub-ui
depends_on:
- api
ports:
- "4200:80"

volumes:
postgres-data:
Loading
Loading