Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/composer-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"config": {
"cache-vcs-dir": "/dev/null",
"platform-check": false,
"preferred-install": {
"*": "dist"
},
"allow-plugins": {
"ergebnis/composer-normalize": true,
"symfony/flex": true
}
}
}
94 changes: 7 additions & 87 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,91 +9,6 @@ on:
- main

jobs:
cs-fixer:
name: 'PHP CS Fixer'

runs-on: 'ubuntu-latest'

strategy:
matrix:
php-version:
- '8.2'

steps:
-
name: 'Check out'
uses: 'actions/checkout@v4'

-
name: 'Set up PHP'
uses: 'shivammathur/setup-php@v2'
with:
php-version: '${{ matrix.php-version }}'
coverage: 'none'

-
name: 'Get Composer cache directory'
id: 'composer-cache'
run: 'echo "cache_dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT'

-
name: 'Cache dependencies'
uses: 'actions/cache@v3'
with:
path: '${{ steps.composer-cache.outputs.cache_dir }}'
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
restore-keys: 'php-${{ matrix.php-version }}-composer-locked-'

-
name: 'Install dependencies'
run: 'composer install --no-progress'

-
name: 'Check the code style'
run: 'make cs'

phpstan:
name: 'PhpStan'

runs-on: 'ubuntu-latest'

strategy:
matrix:
php-version:
- '8.2'

steps:
-
name: 'Check out'
uses: 'actions/checkout@v4'

-
name: 'Set up PHP'
uses: 'shivammathur/setup-php@v2'
with:
php-version: '${{ matrix.php-version }}'
coverage: 'none'

-
name: 'Get Composer cache directory'
id: 'composer-cache'
run: 'echo "cache_dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT'

-
name: 'Cache dependencies'
uses: 'actions/cache@v3'
with:
path: '${{ steps.composer-cache.outputs.cache_dir }}'
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
restore-keys: 'php-${{ matrix.php-version }}-composer-locked-'

-
name: 'Install dependencies'
run: 'composer update --no-progress --prefer-stable'

-
name: 'Run PhpStan'
run: 'vendor/bin/phpstan analyze --no-progress'

tests:
name: 'PHPUnit'
Expand All @@ -118,10 +33,15 @@ jobs:
composer-options: '--prefer-stable'
symfony-version: '^8.0'

-
php-version: '8.5'
composer-options: '--prefer-stable'
symfony-version: '^8.0'

steps:
-
name: 'Check out'
uses: 'actions/checkout@v4'
uses: 'actions/checkout@v6'

-
name: 'Set up PHP'
Expand All @@ -140,7 +60,7 @@ jobs:
uses: 'actions/cache@v3'
with:
path: '${{ steps.composer-cache.outputs.cache_dir }}'
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.json') }}"
restore-keys: 'php-${{ matrix.php-version }}-composer-locked-'

-
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/inspector-bot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: CS

on:
pull_request:

permissions:
contents: read

jobs:
call-inspector-bot:
name: InspectorBot
uses: rollerscapes/inspector-bot/.github/workflows/inspector-bot.yml@main
with:
package: Rollerworks-password-common-list
check_license: true

64 changes: 64 additions & 0 deletions .github/workflows/phpstan.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: PHPStan

on:
pull_request:
branches:
- main

defaults:
run:
shell: bash

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read

jobs:
phpstan:
name: PHPStan
runs-on: ubuntu-24.04

env:
php-version: '8.2'
steps:
-
name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.php-version }}
ini-values: "memory_limit=-1"
coverage: none

-
name: Checkout target branch
uses: actions/checkout@v6
with:
ref: ${{ github.base_ref }}

-
name: Checkout PR
uses: actions/checkout@v6

-
name: Install dependencies
run: |
COMPOSER_HOME="$(composer config home)"
([ -d "$COMPOSER_HOME" ] || mkdir "$COMPOSER_HOME") && cp .github/composer-config.json "$COMPOSER_HOME/config.json"
composer install --no-progress --ansi --no-plugins

-
name: Generate PHPStan baseline
run: |
git checkout composer.json
git checkout -m ${{ github.base_ref }}
vendor/bin/phpstan analyze --generate-baseline --allow-empty-baseline --no-progress
git checkout -m FETCH_HEAD

-
name: PHPStan
run: |
vendor/bin/phpstan analyze --no-progress --error-format=github

3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
"symfony/validator": "^6.4 || ^7.4 || ^8.0"
},
"require-dev": {
"phpstan/phpstan": "^1.10.39",
"phpstan/phpstan-phpunit": "1.3.15",
"phpstan/phpstan-phpunit": "^2.0",
"phpunit/phpunit": "^9.5",
"rollerscapes/standards": "^1.0",
"symfony/framework-bundle": "^6.4 || ^7.4 || ^8.0",
Expand Down
2 changes: 1 addition & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ parameters:
- ./src
- ./tests
excludePaths:
- ./src/Resources
- ./Resources

#ignoreErrors:
Loading