Skip to content

Commit

Permalink
Merge pull request 'develop' (#3) from develop into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Rene Schmidt committed Dec 19, 2024
2 parents 9533d21 + a98fa59 commit a544354
Show file tree
Hide file tree
Showing 53 changed files with 1,395 additions and 999 deletions.
16 changes: 11 additions & 5 deletions .forgejo/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['8.2','8.3']
php-versions: ['8.4','8.3']

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
uses: https://github.com/shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, dom, fileinfo # Add your extensions here.
Expand All @@ -23,7 +23,7 @@ jobs:
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@v3
uses: https://github.com/actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
Expand All @@ -32,5 +32,11 @@ jobs:
- name: Prepare tests
run: composer run-script tests_prepare

- name: Run tests
run: composer run-script tests_run
- name: Run Rector
run: composer run rector

- name: Run PHPStan
run: composer run phpstan

- name: Run PHPUnit
run: composer run phpunit
12 changes: 9 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['8.2','8.3']
php-versions: ['8.4','8.3']

steps:
- name: Checkout code
Expand All @@ -32,5 +32,11 @@ jobs:
- name: Prepare tests
run: composer run-script tests_prepare

- name: Run tests
run: composer run-script tests_run
- name: Run Rector
run: composer run rector

- name: Run PHPStan
run: composer run phpstan

- name: Run PHPUnit
run: composer run phpunit
2 changes: 1 addition & 1 deletion bin/prepare_tests.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh
composer install --no-interaction --prefer-source
composer install --no-interaction #--prefer-source
composer update
24 changes: 3 additions & 21 deletions bin/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,6 @@

mkdir -p ./build/logs

file=/tmp/psr-2-rsd_ruleset_`date +"%d"`.xml
url=https://raw.githubusercontent.com/rene-s/psr-2-rsd/master/psr-2-rsd_ruleset.xml
size=`stat --printf="%s" $file 2>/dev/null`

if [ ! -f $file ] || [ $size -eq 0 ]; then
wget $url -O $file
fi

if [ -f $file ]; then
./vendor/bin/phpcs \
--report=checkstyle \
--report-file=./build/logs/checkstyle.xml \
--standard=./build/phpcs.xml \
-v ./src ./test \
--ignore=./test/bootstrap.php \
--ignore=./test/ui \
--standard=$file
fi

./vendor/bin/phpcpd ./src ./test --exclude=./test/ui
./vendor/bin/phpunit --log-junit ./build/logs/junit.xml test
composer run rector
composer run phpstan
composer run phpunit
10 changes: 7 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"encrypted"
],
"require": {
"php": ">=8.2",
"php": ">=8.3",
"guzzlehttp/guzzle": "~7.7",
"marcusball/case-helper": "~0.2",
"ext-json": "*",
Expand All @@ -30,10 +30,11 @@
"require-dev": {
"monolog/monolog": " ~2.9",
"phpunit/phpunit": "~9.6",
"sebastian/phpcpd": "~6.0",
"squizlabs/php_codesniffer": "~3.7",
"phpunit/php-timer": "~5.0",
"fzaninotto/faker": "~1.5"
"fzaninotto/faker": "~1.5",
"phpstan/phpstan": "^1.11",
"rector/rector": "^1.2"
},
"type": "library",
"autoload": {
Expand All @@ -48,6 +49,9 @@
}
},
"scripts": {
"phpstan": "./vendor/bin/phpstan analyse --memory-limit 2G --configuration phpstan.neon src test",
"phpunit": "./vendor/bin/phpunit --log-junit ./build/logs/junit.xml test",
"rector": "./vendor/bin/rector --no-ansi --no-progress-bar",
"tests_prepare": "./bin/prepare_tests.sh",
"tests_run": "./bin/run_tests.sh"
}
Expand Down
Loading

0 comments on commit a544354

Please sign in to comment.