Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
4785ef3
re organized structure
BibaltiK Nov 7, 2024
5bb782b
update dependecies
BibaltiK Jun 16, 2025
b069b78
adjust workflows
BibaltiK Jun 16, 2025
0703709
fix codesniffer ruleset
BibaltiK Jun 16, 2025
19e54e9
remove zendframework bridge
BibaltiK Jun 16, 2025
43e1c27
clean
BibaltiK Aug 13, 2025
18156d2
initial with Auth
BibaltiK Aug 13, 2025
1b41c87
bump github actions
BibaltiK Aug 13, 2025
dd435d9
-
BibaltiK Aug 13, 2025
7237de4
-
BibaltiK Aug 13, 2025
8d7e6ef
-
BibaltiK Aug 13, 2025
faf9278
-
BibaltiK Aug 13, 2025
cf72b85
-
BibaltiK Aug 13, 2025
0e44a2b
downgrad notify
BibaltiK Aug 13, 2025
c28154f
validate security Schemes
BibaltiK Aug 13, 2025
b2f7ebf
fix deploy uri
BibaltiK Aug 14, 2025
0e92e08
change SwaggerUI Title
BibaltiK Aug 14, 2025
18c48b6
add Account Role Enum
BibaltiK Aug 14, 2025
fe528e9
implements last aktivity updater
BibaltiK Aug 14, 2025
c9ba7b8
change Auth Responsetyp to unauthorized
BibaltiK Aug 14, 2025
d10f08f
add version to composer
BibaltiK Aug 14, 2025
1d32bf5
Bump
BibaltiK Aug 14, 2025
b76c5e2
remove version from composer
BibaltiK Aug 14, 2025
6204456
add version to constants
BibaltiK Aug 14, 2025
ccdce5a
implements Logout Endpoint
BibaltiK Aug 15, 2025
2882ee8
implements authorized validation
BibaltiK Aug 15, 2025
a8c9908
Implements ErrorHandler with Logger
BibaltiK Aug 18, 2025
d01bf10
change route implementation and fix any routes
BibaltiK Aug 18, 2025
1e50272
bump php 8.3 to 8.4.16
BibaltiK Jan 8, 2026
e3a43fc
refactor clone readonly class with new parameter
BibaltiK Jan 8, 2026
ac4bfce
add dev url for webhook
BibaltiK Jan 8, 2026
2fb7be3
add dev url for webhook
BibaltiK Jan 8, 2026
ae32178
add dev url for webhook
BibaltiK Jan 8, 2026
a0f6f48
add dev url for webhook
BibaltiK Jan 8, 2026
5bce715
fix wotkflow
BibaltiK Jan 8, 2026
c1e7099
fix phpunit config
BibaltiK Jan 8, 2026
dafeda7
rewrite script with AI
BibaltiK Jan 11, 2026
ed54a14
rewrite for php 8.4
BibaltiK Jan 11, 2026
f2984af
reorganisation
BibaltiK Jan 11, 2026
3471d5d
Changes for property hook
BibaltiK Jan 11, 2026
305bcf9
refactor: improve bin/hackathon CLI and update documentation
BibaltiK Jan 12, 2026
7c3ce88
bump checkout and rsync actions
BibaltiK Jan 12, 2026
da5fa72
fix package for deployment
BibaltiK Jan 12, 2026
a8d3dd7
-
BibaltiK Jan 12, 2026
4d4d9e5
bump action script
BibaltiK Jan 13, 2026
2c135ba
implements Property Hook AccountAccessAuth
BibaltiK Jan 13, 2026
733de2a
implements Property Hook AccountActivation
BibaltiK Jan 13, 2026
350aeb4
implements Property Hook Token
BibaltiK Jan 13, 2026
502be80
rename Method
BibaltiK Jan 13, 2026
8512fff
moved enum
BibaltiK Jan 13, 2026
2441166
-
BibaltiK Jan 13, 2026
4b8de93
refactor
BibaltiK Jan 14, 2026
de8681f
refactor magic string
BibaltiK Jan 15, 2026
c9a2372
refactor magic string
BibaltiK Jan 15, 2026
767ec23
bumps
BibaltiK Jan 15, 2026
bdee6b0
add required gitkeep
BibaltiK Jan 15, 2026
6564f12
refactor: finalize management CLI, fix volume detection and preserve …
BibaltiK Jan 15, 2026
75a1bc2
refactor: change for php 8.4
BibaltiK Jan 16, 2026
712740c
fix: code quali
BibaltiK Jan 16, 2026
a34a6d8
refactor: change namespace
BibaltiK Jan 16, 2026
57a09b9
add build deployment
BibaltiK Jan 16, 2026
2cfcab9
fix: Deploy Name
BibaltiK Jan 16, 2026
9f1b1bc
Master (#157)
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