Files
quality/.gitea/workflows/quality.yml
2026-03-24 10:36:58 +01:00

77 lines
2.1 KiB
YAML

on:
workflow_call:
inputs:
image:
required: false
type: string
default: git.qlic.nl/qlic/quality:php8.5
username:
required: false
type: string
default: ${{ vars.REGISTRY_USERNAME }}
password:
required: false
type: string
default: ${{ vars.REGISTRY_PASSWORD }}
composer-args:
required: false
type: string
default: '--verbose --prefer-dist --no-progress --no-interaction --optimize-autoloader --ignore-platform-reqs --no-scripts'
composer-audit-args:
required: false
type: string
default: '--abandoned fail'
phpstan-args:
required: false
type: string
default: '--memory-limit=2G'
phpcs-args:
required: false
type: string
default: '--diff --dry-run'
environment-path:
required: false
type: string
default: .env.example
jobs:
quality:
runs-on: ubuntu-24.04
container:
image: ${{ inputs.image }}
credentials:
username: ${{ inputs.username }}
password: ${{ inputs.password }}
steps:
- name: Setup composer
uses: https://git.qlic.nl/actions/setup-composer@v1
with:
args: ${{ inputs.composer-args }}
- name: Cache PHPStan
uses: actions/cache@v4
with:
path: .phpstan
key: phpstan-${{ hashFiles('composer.lock', 'phpstan.dist.neon') }}
- name: Cache PHP CS Fixer
uses: actions/cache@v4
with:
path: .php-cs-fixer.cache
key: phpcs-${{ hashFiles('composer.lock', '.php-cs-fixer.dist.php') }}
- name: Copy ${{ inputs.environment-path }} to .env if it exists
run: |
if [ -f ${{ inputs.environment-path }} ]; then
cp ${{ inputs.environment-path }} .env
fi
- name: Run PHPStan
run: ./vendor/bin/phpstan analyse ${{ inputs.phpstan-args }}
- name: Run php cs fixer
run: ./vendor/bin/php-cs-fixer fix ${{ inputs.phpcs-args }}
- name: Run audit
run: composer audit ${{ inputs.composer-audit-args }}