mirror of
https://github.com/Terranom674/Piwigo_Bratonien_Tools.git
synced 2026-09-19 23:24:36 +00:00
70 lines
1.9 KiB
YAML
70 lines
1.9 KiB
YAML
name: Syntax Check
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
|
|
jobs:
|
|
php-syntax:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
php-version: ['8.2', '8.3', '8.4', '8.5']
|
|
steps:
|
|
- name: Repository auschecken
|
|
uses: actions/checkout@v4
|
|
|
|
- name: PHP installieren
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: ${{ matrix.php-version }}
|
|
coverage: none
|
|
|
|
- name: PHP Syntax pruefen
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
while IFS= read -r -d '' file; do
|
|
php -l "$file"
|
|
done < <(find . -type f -name '*.php' -print0)
|
|
|
|
- name: Doppelte Bratonien-Funktionen pruefen
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
duplicates="$(grep -RhoE 'function[[:space:]]+bratonien_tools_[A-Za-z0-9_]+' --include='*.php' . | awk '{print $2}' | sort | uniq -d || true)"
|
|
if [[ -n "$duplicates" ]]; then
|
|
echo "Doppelte globale Bratonien-Funktionen gefunden:" >&2
|
|
printf '%s\n' "$duplicates" >&2
|
|
exit 1
|
|
fi
|
|
|
|
script-syntax:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Repository auschecken
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Admin JavaScript Syntax pruefen
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
sed -n '/<script>/,/<\/script>/p' template/admin_tabs.tpl | sed '1d;$d' > /tmp/bratonien-admin-tabs.js
|
|
node --check /tmp/bratonien-admin-tabs.js
|
|
node --check js/nc_connector_edit_v2.js
|
|
|
|
- name: Python Syntax pruefen
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
python3 -m compileall -q runtime
|
|
|
|
- name: Shell Syntax pruefen
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
while IFS= read -r -d '' file; do
|
|
bash -n "$file"
|
|
done < <(find . -type f -name '*.sh' -print0)
|