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
61 changes: 0 additions & 61 deletions .github/workflows/tag_meged_pull_request.yml

This file was deleted.

65 changes: 8 additions & 57 deletions .github/workflows/test_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,56 +3,12 @@ name: Test and Static Analysis (Pull Request)
on: pull_request

jobs:
check-version-in-composer-json:
name: Check Version
runs-on: ubuntu-latest

steps:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
tools: composer:v2

- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: PHP Version Check
run: php -v

- name: Validate Composer JSON
run: composer validate

- name: Get Version From Comopser JSON
id: new-version
run: |
echo version=$(cat composer.json | grep version | head -1 | grep -Po '\d+\.\d+\.\d+') >> $GITHUB_OUTPUT

- name: Show New Version
run: echo "version=${{ steps.new-version.outputs.version }}"

- name: Show Tags
run: git tag

- name: Check If The Version Is Not In The Tag List
run: |
for tag in `git tag`
do
if [ $tag = ${{ steps.new-version.outputs.version }} ]; then
echo "version ${{ steps.new-version.outputs.version }} already exists."
exit 1
fi
done
echo "OK."

test-and-static-analysis:
name: Test and Lint
runs-on: ubuntu-latest
strategy:
matrix:
php: ['8.1', '8.2', '8.3', '8.4']
php: ['8.1', '8.2', '8.3', '8.4', '8.5']

steps:
- name: Set up PHP
Expand All @@ -63,12 +19,12 @@ jobs:
tools: composer:v2

- name: Set up Node
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: '20.x'
node-version: '24.x'

- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0

Expand All @@ -88,11 +44,6 @@ jobs:
- name: Neon Lint
run: ./vendor/nette/neon/bin/neon-lint conf

#- name: PHP MD
# run: |
# ./vendor/bin/phpmd --version
# ./vendor/bin/phpmd ./src/ ./examples/ ./tests/ text phpmd.xml

- name: PHP Code Sniffer
run: |
./vendor/bin/phpcs --version
Expand All @@ -115,7 +66,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php: ['8.3']
php: ['8.4']

steps:
- name: Set up PHP
Expand All @@ -126,12 +77,12 @@ jobs:
tools: composer:v2

- name: Set up Node
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: '20.x'
node-version: '24.x'

- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0

Expand Down
1 change: 1 addition & 0 deletions PHP_VERSIONS
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
8.5
8.4
8.3
8.2
Expand Down
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -548,8 +548,4 @@ You can set transparent background like this.

***

*Document created: 2023/05/28*

*Document updated: 2025/01/02*

Copyright 2023 - 2025 macocci7
35 changes: 0 additions & 35 deletions bin/CheckVersion.sh

This file was deleted.

36 changes: 28 additions & 8 deletions bin/TestAndLint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

# Script to Test and Lint
# requirement:
# - https://github.com/jdx/mise installed
# - https://github.com/phpenv/phpenv installed
# - PHP versions defined in ../PHP_VERSIONS installed

CMD=mise
CMD=phpenv
$CMD -v &> /dev/null
if [ $? -ne 0 ]; then
echo "command [${CMD}] not found!"
Expand All @@ -19,13 +19,33 @@ if [ $? -ne 0 ]; then
exit 1
fi

switch_version() {
echo "==========================================================="
echo "[PHP $1][Switching PHP version to $1]"
mise x php@$1 -- bash bin/TestAndLintSub.sh $1;
test_and_lint() {
echo "-----------------------------------------------------------"
echo "[PHP $1][php -v]"
php -v
echo "-----------------------------------------------------------"
echo "[PHP $1][parallel-lint]"
./vendor/bin/parallel-lint src tests examples
echo "-----------------------------------------------------------"
echo "[PHP $1][neon-lint]"
./vendor/nette/neon/bin/neon-lint conf
echo "-----------------------------------------------------------"
echo "[PHP $1][phpcs]"
./vendor/bin/phpcs --ignore=vendor \
--standard=phpcs.xml \
-p \
-s \
.
echo "-----------------------------------------------------------"
echo "[PHP $1][phpstan]"
./vendor/bin/phpstan analyze -c phpstan.neon
echo "-----------------------------------------------------------"
echo "[PHP $1][phpunit]"
./vendor/bin/phpunit ./tests/
echo "-----------------------------------------------------------"
}

echo "[[TestAndLint.sh]]"
echo "[[TesAndLint.sh]]"

SUPPORTED_PHP_VERSIONS=PHP_VERSIONS
if [ ! -f $SUPPORTED_PHP_VERSIONS ]; then
Expand All @@ -40,6 +60,6 @@ if [ ! -r $SUPPORTED_PHP_VERSIONS ]; then
fi
STR_CMD=''
while read version ; do
STR_CMD="$STR_CMD switch_version $version;"
STR_CMD="$STR_CMD test_and_lint $version;"
done < $SUPPORTED_PHP_VERSIONS
eval $STR_CMD
34 changes: 0 additions & 34 deletions bin/TestAndLintSub.sh

This file was deleted.

7 changes: 3 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
{
"name": "macocci7/php-boxplot",
"version": "1.3.1",
"description": "it's easy to use for creating boxplots.",
"description": "PHP-Boxplot creates boxplots using FrequencyTable.",
"type": "library",
"require": {
"php": ">=8.1",
"macocci7/php-frequency-table": "^1.4",
"fakerphp/faker": "^1.24",
"nette/neon": "^3.4",
"macocci7/php-plotter2d": "^0.3"
"macocci7/php-plotter2d": "^0.4"
},
"require-dev": {
"squizlabs/php_codesniffer": "^3.11",
"squizlabs/php_codesniffer": "^4.0",
"phpunit/phpunit": "^10.5",
"phpstan/phpstan": "^2.1",
"php-parallel-lint/php-parallel-lint": "^1.4"
Expand Down
1 change: 0 additions & 1 deletion tests/Helpers/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public function test_load_can_load_config_file_correctly(): void
Config::load();
$r = new \ReflectionClass(Config::class);
$p = $r->getProperty('conf');
$p->setAccessible(true);
$this->assertSame(
Neon::decodeFile($this->testConf),
$p->getValue()[$this::class]
Expand Down