Skip to content

Commit

Permalink
New codestyle and PHP 8.1+ (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
SmetDenis committed Mar 25, 2023
1 parent 5f4dc89 commit 8124b70
Show file tree
Hide file tree
Showing 156 changed files with 5,642 additions and 6,645 deletions.
5 changes: 2 additions & 3 deletions .dockerignore
@@ -1,14 +1,13 @@
#
# JBZoo Toolbox - CI-Report-Converter
# JBZoo Toolbox - CI-Report-Converter.
#
# This file is part of the JBZoo Toolbox project.
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
#
# @package CI-Report-Converter
# @license MIT
# @copyright Copyright (C) JBZoo.com, All rights reserved.
# @link https://github.com/JBZoo/CI-Report-Converter
# @see https://github.com/JBZoo/CI-Report-Converter
#

.git
Expand Down
5 changes: 2 additions & 3 deletions .editorconfig
@@ -1,14 +1,13 @@
#
# JBZoo Toolbox - CI-Report-Converter
# JBZoo Toolbox - CI-Report-Converter.
#
# This file is part of the JBZoo Toolbox project.
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
#
# @package CI-Report-Converter
# @license MIT
# @copyright Copyright (C) JBZoo.com, All rights reserved.
# @link https://github.com/JBZoo/CI-Report-Converter
# @see https://github.com/JBZoo/CI-Report-Converter
#

# EditorConfig is awesome: http://EditorConfig.org
Expand Down
5 changes: 2 additions & 3 deletions .gitattributes
@@ -1,14 +1,13 @@
#
# JBZoo Toolbox - CI-Report-Converter
# JBZoo Toolbox - CI-Report-Converter.
#
# This file is part of the JBZoo Toolbox project.
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
#
# @package CI-Report-Converter
# @license MIT
# @copyright Copyright (C) JBZoo.com, All rights reserved.
# @link https://github.com/JBZoo/CI-Report-Converter
# @see https://github.com/JBZoo/CI-Report-Converter
#

/.github export-ignore
Expand Down
5 changes: 2 additions & 3 deletions .github/release-drafter.yml
@@ -1,14 +1,13 @@
#
# JBZoo Toolbox - CI-Report-Converter
# JBZoo Toolbox - CI-Report-Converter.
#
# This file is part of the JBZoo Toolbox project.
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
#
# @package CI-Report-Converter
# @license MIT
# @copyright Copyright (C) JBZoo.com, All rights reserved.
# @link https://github.com/JBZoo/CI-Report-Converter
# @see https://github.com/JBZoo/CI-Report-Converter
#

name-template: '$RESOLVED_VERSION'
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/gh-action.yml
@@ -1,14 +1,13 @@
#
# JBZoo Toolbox - CI-Report-Converter
# JBZoo Toolbox - CI-Report-Converter.
#
# This file is part of the JBZoo Toolbox project.
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
#
# @package CI-Report-Converter
# @license MIT
# @copyright Copyright (C) JBZoo.com, All rights reserved.
# @link https://github.com/JBZoo/CI-Report-Converter
# @see https://github.com/JBZoo/CI-Report-Converter
#

name: GitHub Action
Expand Down
116 changes: 81 additions & 35 deletions .github/workflows/main.yml
@@ -1,14 +1,13 @@
#
# JBZoo Toolbox - CI-Report-Converter
# JBZoo Toolbox - CI-Report-Converter.
#
# This file is part of the JBZoo Toolbox project.
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
#
# @package CI-Report-Converter
# @license MIT
# @copyright Copyright (C) JBZoo.com, All rights reserved.
# @link https://github.com/JBZoo/CI-Report-Converter
# @see https://github.com/JBZoo/CI-Report-Converter
#

name: CI
Expand All @@ -19,9 +18,7 @@ on:
- "*"
push:
branches:
- master
tags:
- '*'
- 'master'
schedule:
- cron: '30 */8 * * *'

Expand All @@ -31,65 +28,67 @@ env:

jobs:
phpunit:
name: PHPUnit Tests
name: PHPUnit
runs-on: ubuntu-latest
env:
JBZOO_COMPOSER_UPDATE_FLAGS: ${{ matrix.composer_flags }}
strategy:
matrix:
php-version: [ 7.4, 8.0, 8.1 ]
build-way: [ "update" ]
php-version: [ 8.1, 8.2 ]
coverage: [ xdebug, none ]
composer_flags: [ "--prefer-lowest", "" ]
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup PHP and composer
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: xdebug
coverage: ${{ matrix.coverage }}
tools: composer
extensions: ast

- name: Build the Project
run: make build ${{ matrix.build-way }} --no-print-directory
run: make update --no-print-directory

- name: 🧪 PHPUnit Tests
run: make test --no-print-directory

- name: Uploading coverage to coveralls
if: ${{ matrix.coverage == 'xdebug' }}
continue-on-error: true
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: make report-coveralls --no-print-directory || true

- name: Codecov Report
uses: codecov/codecov-action@v1
- name: Upload Artifacts
uses: actions/upload-artifact@v3
continue-on-error: true
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: '*.xml'
directory: ./build/coverage_xml/
fail_ci_if_error: true
name: PHPUnit - ${{ matrix.php-version }} - ${{ matrix.coverage }}
path: build/


linters:
name: Linters
runs-on: ubuntu-latest
strategy:
matrix:
php-version: [ 7.4, 8.0, 8.1 ]
php-version: [ 8.1, 8.2 ]
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup PHP and composer
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: none
tools: composer
extensions: ast

Expand All @@ -99,46 +98,93 @@ jobs:
- name: 👍 Code Quality
run: make codestyle --no-print-directory

- name: Upload Artifacts
uses: actions/upload-artifact@v3
continue-on-error: true
with:
name: Linters - ${{ matrix.php-version }}
path: build/


report:
name: Reports
runs-on: ubuntu-latest
strategy:
matrix:
php-version: [ 8.1, 8.2 ]
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: xdebug
tools: composer
extensions: ast

- name: Build the Project
run: make update --no-print-directory

- name: 📝 Build Reports
run: make report-all --no-print-directory

- name: Upload Artifacts
uses: actions/upload-artifact@v3
continue-on-error: true
with:
name: Reports - ${{ matrix.php-version }}
path: build/


phar:
name: Phar
runs-on: ubuntu-latest
needs: [ phpunit, linters, report ]
strategy:
matrix:
php-version: [ 7.4, 8.0, 8.1 ]
experimental: [ false ]
build-way: [ "build", "update build" ]
include:
- php-version: 8.0
experimental: true
build-way: update
php-version: [ 8.1, 8.2 ]
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup PHP and composer
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: xdebug
tools: composer
extensions: ast

- name: Build the project
run: make build --no-print-directory

- name: Building Phar binary file
continue-on-error: ${{ matrix.experimental }}
run: make ${{ matrix.build-way }} --no-print-directory
run: make build-phar --no-print-directory

- name: Trying to use the phar file
continue-on-error: ${{ matrix.experimental }}
run: ./build/ci-report-converter.phar convert --help

- name: Upload Artifacts
uses: actions/upload-artifact@v3
continue-on-error: true
with:
name: Reports - ${{ matrix.php-version }}
path: build/


docker:
name: Docker
runs-on: ubuntu-latest
needs: [ phar ]
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/release-docker.yml
@@ -1,14 +1,13 @@
#
# JBZoo Toolbox - CI-Report-Converter
# JBZoo Toolbox - CI-Report-Converter.
#
# This file is part of the JBZoo Toolbox project.
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
#
# @package CI-Report-Converter
# @license MIT
# @copyright Copyright (C) JBZoo.com, All rights reserved.
# @link https://github.com/JBZoo/CI-Report-Converter
# @see https://github.com/JBZoo/CI-Report-Converter
#

name: Publish Docker Image
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/release-draft.yml
@@ -1,14 +1,13 @@
#
# JBZoo Toolbox - CI-Report-Converter
# JBZoo Toolbox - CI-Report-Converter.
#
# This file is part of the JBZoo Toolbox project.
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
#
# @package CI-Report-Converter
# @license MIT
# @copyright Copyright (C) JBZoo.com, All rights reserved.
# @link https://github.com/JBZoo/CI-Report-Converter
# @see https://github.com/JBZoo/CI-Report-Converter
#

name: Draft Release
Expand Down
5 changes: 2 additions & 3 deletions .gitignore
@@ -1,14 +1,13 @@
#
# JBZoo Toolbox - CI-Report-Converter
# JBZoo Toolbox - CI-Report-Converter.
#
# This file is part of the JBZoo Toolbox project.
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
#
# @package CI-Report-Converter
# @license MIT
# @copyright Copyright (C) JBZoo.com, All rights reserved.
# @link https://github.com/JBZoo/CI-Report-Converter
# @see https://github.com/JBZoo/CI-Report-Converter
#

.idea
Expand Down
17 changes: 9 additions & 8 deletions .phan.php
@@ -1,30 +1,31 @@
<?php

/**
* JBZoo Toolbox - CI-Report-Converter
* JBZoo Toolbox - CI-Report-Converter.
*
* This file is part of the JBZoo Toolbox project.
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @package CI-Report-Converter
* @license MIT
* @copyright Copyright (C) JBZoo.com, All rights reserved.
* @link https://github.com/JBZoo/CI-Report-Converter
* @see https://github.com/JBZoo/CI-Report-Converter
*/

declare(strict_types=1);

$default = include __DIR__ . '/vendor/jbzoo/codestyle/src/phan/default.php';
$default = include __DIR__ . '/vendor/jbzoo/codestyle/src/phan.php';

return array_merge($default, [
return \array_merge($default, [
'directory_list' => [
'src',

'vendor/jbzoo/cli/src',
'vendor/jbzoo/data/src',
'vendor/jbzoo/utils/src',
'vendor/jbzoo/cli/src',
'vendor/jbzoo/markdown/src',

'vendor/symfony/console',
]

'vendor/jbzoo/markdown/src',
],
]);

0 comments on commit 8124b70

Please sign in to comment.