Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
upgraded PHP version to latest (PHP 8.4), some changes to checks.sh
  • Loading branch information
dam-bal committed Dec 6, 2024
commit 02d89565f689ce447b8c235f70af1529202a25ae
2 changes: 1 addition & 1 deletion .docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:8.2-cli
FROM php:8.4-cli

RUN pecl install xdebug && docker-php-ext-enable xdebug

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
fail-fast: true
matrix:
os: [ ubuntu-latest ]
php: [ 8.2 ]
php: [ 8.4 ]
stability: [ prefer-stable ]

name: PHP-${{ matrix.php }} - ${{ matrix.stability }} - ${{ matrix.os }}
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ Description
composer require dam-bal/project
```

## Checks

```shell
docker compose run --rm php sh checks.sh
```

## Release History

* 0.1.0
Expand Down
39 changes: 34 additions & 5 deletions checks.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,38 @@
docker compose run --rm phpunit
#!/usr/bin/env sh

docker compose run --rm phpcs
run_command() {
temp_file=$(mktemp)
$1 >"$temp_file" 2>&1

docker compose run --rm phpstan
if [ $? -eq 0 ]; then
echo "\e[32mSUCCESS\e[0m"
rm "$temp_file"
else
echo "\e[31mFAIL\e[0m"
cat "$temp_file"
rm "$temp_file"
fi
}

docker compose run --rm phpmd
echo "#########"
echo "# Tests #"
echo "#########"
run_command "./vendor/bin/phpunit"

docker compose run --rm phplint
echo ""
echo "###################"
echo "# Static Analysis #"
echo "###################"
run_command "./vendor/bin/phpstan analyse src --level 9"

echo ""
echo "##################"
echo "# Mess Detection #"
echo "##################"
run_command "./vendor/bin/phpmd src/ text codesize,unusedcode,design,cleancode"

echo ""
echo "###################"
echo "# Code Formatting #"
echo "###################"
run_command "./vendor/bin/phpcs --standard=PSR12 src/"
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"description": "Description",
"license": "MIT",
"type": "library",
"version": "1.0.0",
"authors": [
{
"name": "Damian Balandowski",
Expand All @@ -20,7 +21,7 @@
}
},
"require": {
"php": "^8.2"
"php": "^8.4"
},
"require-dev": {
"mockery/mockery": "^1.6",
Expand Down
Loading