diff --git a/.github/workflows/tag_meged_pull_request.yml b/.github/workflows/tag_meged_pull_request.yml deleted file mode 100644 index f26a4df..0000000 --- a/.github/workflows/tag_meged_pull_request.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: Set Tag to Merged Pull Request - -on: - pull_request: - branches: - - main - types: - - closed - -jobs: - set-tag: - name: Get tags, Check and Set tag - runs-on: ubuntu-latest - permissions: - contents: write - - steps: - - name: Set up PHP - uses: shivammathur/setup-php@v2 - with: - php-version: 8.3 - coverage: xdebug - 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.]" - - - name: Set tag - run: | - git tag ${{ steps.new-version.outputs.version }} - git push origin ${{ steps.new-version.outputs.version }} diff --git a/.github/workflows/test_pull_request.yml b/.github/workflows/test_pull_request.yml index d335be9..cafbcc9 100644 --- a/.github/workflows/test_pull_request.yml +++ b/.github/workflows/test_pull_request.yml @@ -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 @@ -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 @@ -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 @@ -115,7 +66,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php: ['8.3'] + php: ['8.4'] steps: - name: Set up PHP @@ -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 diff --git a/PHP_VERSIONS b/PHP_VERSIONS index 75df3c4..2563267 100644 --- a/PHP_VERSIONS +++ b/PHP_VERSIONS @@ -1,3 +1,4 @@ +8.5 8.4 8.3 8.2 diff --git a/README.md b/README.md index 6c934cd..9fde465 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/bin/CheckVersion.sh b/bin/CheckVersion.sh deleted file mode 100644 index 48f03e1..0000000 --- a/bin/CheckVersion.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/bash - -# Script to check -# if the version in composer.json -# is not in git tags - -if [ ! -r composer.json ]; then - echo "composer.json not found." - echo "operation aborted." - exit 1 -fi - -VERSION=$(cat composer.json | grep version | head -1 | grep -Po '\d+\.\d+\.\d+') -printf 'version in composer.json: \033[1;33m%s\033[m\n' $VERSION - - -show_latest_tags() { - echo "The latest $1 tags are:" - for tag in `git tag | sort | tail -$1` - do - printf '\033[93m%s\033[m\n' $tag - done -} - -for tag in `git tag` -do - if [ $tag = $VERSION ]; then - printf '\033[41m Error! version %s already exists in git tags. \033[m\n' $VERSION - show_latest_tags 3 - exit 1 - fi -done -printf '\033[1;102m%s\033[m\n' " OK! versoin $VERSION is not in git tags. " -show_latest_tags 3 -printf '\033[93m%s\033[m\n' "Don't forget to run \`composer update\` before commit." diff --git a/bin/TestAndLint.sh b/bin/TestAndLint.sh index 4a3b743..0b6dff2 100644 --- a/bin/TestAndLint.sh +++ b/bin/TestAndLint.sh @@ -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!" @@ -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 @@ -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 diff --git a/bin/TestAndLintSub.sh b/bin/TestAndLintSub.sh deleted file mode 100644 index 28e2d19..0000000 --- a/bin/TestAndLintSub.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/bash - -# Script to Test and Lint -# requirement: -# - PHP versions defined in ../PHP_VERSIONS installed - -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][phpmd]" -#./vendor/bin/phpmd \ -# ./src/ ./examples/ ./tests/ text \ -# phpmd.xml -echo "-----------------------------------------------------------" -echo "[PHP $1][phpstan]" -./vendor/bin/phpstan analyze -c phpstan.neon -echo "-----------------------------------------------------------" -echo "[PHP $1][phpunit]" -./vendor/bin/phpunit ./tests/ -echo "-----------------------------------------------------------" diff --git a/composer.json b/composer.json index 7440aa7..3b80d8a 100644 --- a/composer.json +++ b/composer.json @@ -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" diff --git a/tests/Helpers/ConfigTest.php b/tests/Helpers/ConfigTest.php index fb9f8c6..3c6558b 100644 --- a/tests/Helpers/ConfigTest.php +++ b/tests/Helpers/ConfigTest.php @@ -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]