Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
f14b9fe
re organized structure
BibaltiK Nov 7, 2024
f0a39e0
update dependecies
BibaltiK Jun 16, 2025
47fa610
adjust workflows
BibaltiK Jun 16, 2025
b838ee0
fix codesniffer ruleset
BibaltiK Jun 16, 2025
093f6ae
remove zendframework bridge
BibaltiK Jun 16, 2025
b707d13
clean
BibaltiK Aug 13, 2025
3d4a484
initial with Auth
BibaltiK Aug 13, 2025
e6df252
bump github actions
BibaltiK Aug 13, 2025
d480cd7
-
BibaltiK Aug 13, 2025
073cd2f
-
BibaltiK Aug 13, 2025
999cf9e
-
BibaltiK Aug 13, 2025
aec804a
-
BibaltiK Aug 13, 2025
dccc3d4
-
BibaltiK Aug 13, 2025
4445953
downgrad notify
BibaltiK Aug 13, 2025
1e76465
validate security Schemes
BibaltiK Aug 13, 2025
8c3b281
fix deploy uri
BibaltiK Aug 14, 2025
db59b8b
change SwaggerUI Title
BibaltiK Aug 14, 2025
238dd4d
add Account Role Enum
BibaltiK Aug 14, 2025
4fc3887
implements last aktivity updater
BibaltiK Aug 14, 2025
637bb2a
change Auth Responsetyp to unauthorized
BibaltiK Aug 14, 2025
a6b5f42
add version to composer
BibaltiK Aug 14, 2025
e091149
Bump
BibaltiK Aug 14, 2025
cfca6d5
remove version from composer
BibaltiK Aug 14, 2025
348b3bb
add version to constants
BibaltiK Aug 14, 2025
fa00ef0
implements Logout Endpoint
BibaltiK Aug 15, 2025
fb99629
implements authorized validation
BibaltiK Aug 15, 2025
abb0a95
Implements ErrorHandler with Logger
BibaltiK Aug 18, 2025
6687e0c
change route implementation and fix any routes
BibaltiK Aug 18, 2025
4714a4e
bump php 8.3 to 8.4.16
BibaltiK Jan 8, 2026
a4ca653
refactor clone readonly class with new parameter
BibaltiK Jan 8, 2026
03d8833
add dev url for webhook
BibaltiK Jan 8, 2026
e38b716
add dev url for webhook
BibaltiK Jan 8, 2026
ebadf6b
add dev url for webhook
BibaltiK Jan 8, 2026
529703c
add dev url for webhook
BibaltiK Jan 8, 2026
271bb7b
fix wotkflow
BibaltiK Jan 8, 2026
fcb6581
fix phpunit config
BibaltiK Jan 8, 2026
92f3546
rewrite script with AI
BibaltiK Jan 11, 2026
4cbd256
rewrite for php 8.4
BibaltiK Jan 11, 2026
66f96a6
reorganisation
BibaltiK Jan 11, 2026
3931f5d
Changes for property hook
BibaltiK Jan 11, 2026
c3f25e0
refactor: improve bin/hackathon CLI and update documentation
BibaltiK Jan 12, 2026
08d45cb
bump checkout and rsync actions
BibaltiK Jan 12, 2026
a167b61
fix package for deployment
BibaltiK Jan 12, 2026
19a963e
-
BibaltiK Jan 12, 2026
e7a44de
bump action script
BibaltiK Jan 13, 2026
547ff5e
implements Property Hook AccountAccessAuth
BibaltiK Jan 13, 2026
a4c58a0
implements Property Hook AccountActivation
BibaltiK Jan 13, 2026
061b392
implements Property Hook Token
BibaltiK Jan 13, 2026
622bca7
rename Method
BibaltiK Jan 13, 2026
5df7f2a
moved enum
BibaltiK Jan 13, 2026
108423d
-
BibaltiK Jan 13, 2026
f2440b0
refactor
BibaltiK Jan 14, 2026
bfe937e
refactor magic string
BibaltiK Jan 15, 2026
be6011a
refactor magic string
BibaltiK Jan 15, 2026
a1baefc
bumps
BibaltiK Jan 15, 2026
fa05c7f
add required gitkeep
BibaltiK Jan 15, 2026
f75d9df
refactor: finalize management CLI, fix volume detection and preserve …
BibaltiK Jan 15, 2026
d57dfac
refactor: change for php 8.4
BibaltiK Jan 16, 2026
1dc8c4b
fix: code quali
BibaltiK Jan 16, 2026
d733662
refactor: change namespace
BibaltiK Jan 16, 2026
5684b9a
add build deployment
BibaltiK Jan 16, 2026
91ef8dd
fix: Deploy Name
BibaltiK Jan 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .env.dist
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#docker configuration
ENV=dev
APP_ENV=develope
USERMAP_UID=1000
USERMAP_GID=984
MYSQL_USER=dev
MYSQL_PASSWORD=dev
MYSQL_ROOT_PASSWORD=root
MYSQL_DATABASE=db
MYSQL_PUBLIC_PORT=3306
MYSQL_TESTING_PORT=3307
PHP_VERSION=8.3
MARIADB_VERSION=latest
APACHE_VERSION=2.4-alpine
Expand Down
30 changes: 30 additions & 0 deletions .github/actions/setup-php-composer/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# .github/actions/setup-php-composer/action.yml
name: 'Setup PHP and Composer'
description: 'Common setup for PHP jobs'
inputs:
php-version:
description: 'PHP Version'
default: '8.4'
install-flags:
description: 'Composer install flags'
default: '--prefer-dist --no-progress'

runs:
using: "composite"
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ inputs.php-version }}
extensions: pdo, mbstring # hier Standard-Extensions ergänzen

- name: Cache Composer packages
uses: actions/cache@v5
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-php-

- name: Install dependencies
shell: bash
run: composer install ${{ inputs.install-flags }}
194 changes: 77 additions & 117 deletions .github/workflows/codestyle-and-unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,147 +4,107 @@ on:
branches:
- '*'
- '!master'
- '!develop'
paths:
- "**.php"
pull_request:
workflow_dispatch:

jobs:
phplint:
name: PHP Lint
runs-on: ubuntu-20.04

# 1. Job: Statische Analyse (Lint, Stan, CodeSniffer)
# Diese laufen zusammen, da sie keine Datenbank benötigen.
static-analysis:
name: PHP Quality Checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.1

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- uses: actions/checkout@v6.0.2

- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Setup PHP and Composer
uses: ./.github/actions/setup-php-composer

- name: Run PHP Linter
run: composer run-script phplint

phpstan:
name: PHP Stan
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v4.1.1

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-

- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Run PHP Stan
run: composer run-script phpstan

phpcs:
name: PHP CodeSniffer
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v4.1.1

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-

- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Run PHP Codesniffer
run: composer run-script phpcs

phpunit:
name: PHP Unit Test
needs:
- phplint
- phpstan
- phpcs
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v4.1.1

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
- name: Notify Failure
if: failure()
uses: rjstone/discord-webhook-notify@v1.0.4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
severity: error
details: Static Analysis (Lint/Stan/CS) failed.
webhookUrl: ${{ secrets.WEBHOOK_DISCORD_URL }}

# 2. Job: Tests (Unit & Functional)
# Dieser Job benötigt die MariaDB Service-Container
tests:
name: PHP Tests
needs: static-analysis
runs-on: ubuntu-latest
services:
database-testing:
image: mariadb:latest
env:
MYSQL_ALLOW_EMPTY_PASSWORD: false
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: db
MYSQL_USER: dev
MYSQL_PASSWORD: dev
ports:
- 3306:3306
options: --health-cmd="healthcheck.sh --connect --innodb_initialized" --health-interval=10s --health-timeout=5s --health-retries=3
env:
DB_DATABASE: db
DB_USERNAME: dev
DB_PASSWORD: dev
DB_HOST: 127.0.0.1
DB_PORT: 3306
APP_ENV: action
steps:
- uses: actions/checkout@v6.0.2

- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Setup PHP and Composer
uses: ./.github/actions/setup-php-composer

- name: Run PHP Unit Test
run: composer run-script unittest

phpfunctional:
name: PHP Functional Test
needs:
- phplint
- phpstan
- phpcs
runs-on: ubuntu-20.04
- name: Run PHP Functional Test
run: composer run-script functionaltest

- name: Notify Failure
if: failure()
uses: rjstone/discord-webhook-notify@v1.0.4
with:
severity: error
details: Unit or Functional Tests failed.
webhookUrl: ${{ secrets.WEBHOOK_DISCORD_URL }}

# 3. Job: Abschluss-Benachrichtigung
final-status:
name: Final Status Message
needs: [static-analysis, tests]
if: always()
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.1

- name: Install PHP with extensions.
uses: shivammathur/setup-php@v2
- name: Check Info Success
if: ${{ needs.static-analysis.result == 'success' && needs.tests.result == 'success' }}
uses: rjstone/discord-webhook-notify@v1.0.4
with:
php-version: 8.3
extensions: pdo, pdo_sqlite
ini-values: date.timezone='UTC'
severity: info
details: Checks successfully executed on API.
webhookUrl: ${{ secrets.WEBHOOK_DISCORD_URL }}

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
- name: Check Info Failure
if: ${{ needs.static-analysis.result != 'success' || needs.tests.result != 'success' }}
uses: rjstone/discord-webhook-notify@v1.0.4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-

- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Run PHP Unit Test
run: composer run-script functionaltest
severity: error
details: >-
${{ format('❌ Incorrect checks during the API check. [View Logs](https://github.com/{0}/actions/runs/{1})',
github.repository,
github.run_id) }}
webhookUrl: ${{ secrets.WEBHOOK_DISCORD_URL }}
121 changes: 121 additions & 0 deletions .github/workflows/deploy_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
name: Deployment on Build
on:
push:
branches: [ "master" ]
workflow_dispatch:

jobs:
# 1. Statische Analyse (Zusammengefasst, da sie keine DB brauchen)
static-analysis:
name: PHP Quality Checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.2

- name: Setup Environment
uses: ./.github/actions/setup-php-composer

- name: Validate Composer
run: composer validate --strict

- name: Run Checks
run: |
composer run-script phplint
composer run-script phpstan
composer run-script phpcs

- name: Notify Failure
if: failure()
uses: rjstone/discord-webhook-notify@v1.0.4
with:
severity: error
details: Static Analysis (Lint/Stan/CS) failed.
webhookUrl: ${{ secrets.WEBHOOK_DISCORD_URL }}

# 2. Tests (Unit & Functional getrennt, da Functional DB braucht)
tests:
name: PHP Tests
needs: static-analysis
runs-on: ubuntu-latest
services:
mariadb:
image: mariadb:latest
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: db
MYSQL_USER: dev
MYSQL_PASSWORD: dev
ports: ["3306:3306"]
options: --health-cmd="healthcheck.sh --connect --innodb_initialized" --health-interval=10s --health-timeout=5s --health-retries=3
env:
DB_DATABASE: db
DB_USERNAME: dev
DB_PASSWORD: dev
DB_HOST: 127.0.0.1
APP_ENV: action
steps:
- uses: actions/checkout@v6.0.2
- name: Setup Environment
uses: ./.github/actions/setup-php-composer

- name: Run Unit Tests
run: composer run-script unittest

- name: Run Functional Tests
run: composer run-script functionaltest

- name: Notify Failure
if: failure()
uses: rjstone/discord-webhook-notify@v1.0.4
with:
severity: error
details: PHP Tests failed.
webhookUrl: ${{ secrets.WEBHOOK_DISCORD_URL }}

# 3. Deployment
deploy:
name: Deploy to Dev
needs: tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.2

- name: Setup Environment (No Dev)
uses: ./.github/actions/setup-php-composer
with:
install-flags: '--prefer-dist --no-progress --no-dev'

- name: Build OpenAPI
run: composer run-script openapi

- name: Deploy via rsync
uses: burnett01/rsync-deployments@8.0.3
with:
switches: -avz --no-o --no-g --no-perms --no-t --omit-dir-times --delete --exclude-from='.rsync-exclude'
remote_path: ${{ secrets.DEPLOY_PATH_API_BUILD }}
remote_host: ${{ secrets.DEPLOY_HOST }}
remote_port: ${{ secrets.DEPLOY_PORT }}
remote_user: ${{ secrets.DEPLOY_USER }}
remote_key: ${{ secrets.DEPLOY_KEY }}
remote_key_pass: ${{ secrets.DEPLOY_KEY_PASS }}

- name: Clear Cache
uses: appleboy/ssh-action@v1.2.2
with:
host: ${{ secrets.DEPLOY_HOST }}
username: ${{ secrets.DEPLOY_USER }}
key: ${{ secrets.DEPLOY_KEY }}
passphrase: ${{ secrets.DEPLOY_KEY_PASS }}
script: rm -rf ${{ secrets.DEPLOY_PATH_API_BUILD }}/data/cache/*

- name: Deployment Notification
if: always()
uses: rjstone/discord-webhook-notify@v1.0.4
with:
severity: ${{ job.status == 'success' && 'info' || 'error' }}
details: >-
${{ job.status == 'success'
&& '[🚀 Successful deployment to build!](https://build.ownhackathon.de/api/docs)'
|| format('[❌ Deployment failed! View Logs](https://github.com/{0}/actions/runs/{1})', github.repository, github.run_id)
}}
webhookUrl: ${{ secrets.WEBHOOK_DISCORD_URL }}
Loading