Compare commits

...

9 Commits

Author SHA1 Message Date
ff2e5816b0 feature/image (#9)
Reviewed-on: #9
Co-authored-by: Johan Rooijakkers <johan@qlic.nl>
Co-committed-by: Johan Rooijakkers <johan@qlic.nl>
2025-03-05 17:07:37 +00:00
ce508a66d5 change default image (#8)
Co-authored-by: Johan Rooijakkers <johan@qlic.nl>
Reviewed-on: #8
2025-03-05 17:01:55 +00:00
74bc98d49d Merge pull request 'can provide own image' (#7) from feature/image into main
Reviewed-on: #7
2025-03-05 16:40:14 +00:00
d459669371 can provide own image 2025-03-05 17:31:31 +01:00
a0f0fd27c6 Merge pull request 'Update readme' (#4) from update-readme into main
Reviewed-on: #4
2025-02-05 18:44:26 +00:00
66712a74ba Update readme 2025-02-05 19:44:08 +01:00
38c236e286 Merge pull request 'Add composer-args' (#3) from add-composer-args into main
Reviewed-on: #3
2025-02-05 18:31:19 +00:00
1f81efa4ef Add composer-args 2025-02-05 19:30:48 +01:00
2f73945f8f Add more caching (#2)
Reviewed-on: #2
2025-01-29 19:14:27 +00:00
2 changed files with 39 additions and 9 deletions

View File

@ -1,6 +1,10 @@
on:
workflow_call:
inputs:
image:
required: false
type: string
default: git.qlic.nl/qlic/quality:php8.3
username:
required: false
type: string
@ -9,27 +13,45 @@ on:
required: false
type: string
default: ${{ vars.REGISTRY_PASSWORD }}
environment_path:
composer-args:
required: false
type: string
default: .env.phpstan
default: '--verbose --prefer-dist --no-progress --no-interaction --optimize-autoloader --ignore-platform-reqs --no-scripts'
environment-path:
required: false
type: string
default: .env.example
jobs:
quality:
runs-on: ubuntu-24.04
container:
image: git.qlic.nl/qlic/quality:latest
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: Copy ${{ inputs.environment_path }} to .env if it exists
- 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
if [ -f ${{ inputs.environment-path }} ]; then
cp ${{ inputs.environment-path }} .env
fi
- name: Run PHPStan
@ -37,6 +59,6 @@ jobs:
- name: Run php cs fixer
run: ./vendor/bin/php-cs-fixer fix --diff --dry-run
- name: Run audit
run: composer audit
run: composer audit

View File

@ -10,7 +10,7 @@ jobs:
uses: your-repo/.github/workflows/quality.yml@main
```
### Secrets and Input Parameters
### Input Parameters
- **username** (optional):
- **Type:** `string`
@ -22,6 +22,14 @@ jobs:
- **Default:** `${{ vars.REGISTRY_PASSWORD }}`
- **Description:** Password for Docker registry authentication. If not provided, the workflow uses the default value from the `REGISTRY_PASSWORD` environment variable.
- **composer-args** (optional):
- **Type:** `string`
- **Default:**
```bash
--verbose --prefer-dist --no-progress --no-interaction --no-dev --optimize-autoloader --ignore-platform-reqs --no-scripts
```
- **Description:** Arguments passed to the Composer setup command for PHP dependency installation. These arguments can be customized based on specific requirements.
## Workflow Job: `quality`
The `quality` job runs quality checks on the PHP codebase using the latest version of a Docker image specifically built for quality analysis.