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
52 changes: 48 additions & 4 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3, 7.4]
php: [5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0]
stability: [prefer-stable]

steps:
Expand Down Expand Up @@ -40,7 +40,11 @@ jobs:
env:
CI_PHP_VERSION: ${{ matrix.php }}
run: |
composer install --no-interaction --no-progress
if [[ ${CI_PHP_VERSION:0:1} == "8" ]]; then
composer install --no-interaction --no-progress --ignore-platform-reqs
else
composer install --no-interaction --no-progress
fi
if [[ ${CI_PHP_VERSION:0:3} == "7.1" ]]; then
# 1) delete sebastian dependency hell
composer remove phpunit/phpunit --dev --no-interaction && composer remove sebastian/phpcpd --no-interaction;
Expand All @@ -51,18 +55,58 @@ jobs:
# 4) install suggested tools
bin/suggested-tools.sh install;
fi
if [ ${CI_PHP_VERSION:0:3} == "7.4" ] || [ ${CI_PHP_VERSION:0:1} == "8" ]; then
# 1) delete sebastian dependency hell
composer remove phpunit/phpunit --dev --no-interaction && composer remove sebastian/phpcpd --no-interaction;
# 2) update tools
composer update;
# 3) reinstall latest versions TODO: phpcpd v6
composer require phpunit/phpunit --dev;
# 4) install suggested tools
bin/suggested-tools.sh install;
# 5) fix new php versions
php tests/.phpunit/fix-typehints.php
fi
# test installing suggested tools like docker image
if [[ ${CI_PHP_VERSION:0:3} == "7.2" ]]; then
bin/suggested-tools.sh install --prefer-dist;
fi
echo

- name: Show versions
env:
CI_PHP_VERSION: ${{ matrix.php }}
run: |
composer outdated --direct --all
if [[ ${CI_PHP_VERSION:0:3} == "8" ]]; then
# TODO: enable phpqa when robo v2 is supported
echo "Old robo causes fatal errors on php8..."
else
./phpqa tools
fi

- name: Run tests
env:
CI_PHP_VERSION: ${{ matrix.php }}
run: |
vendor/phpunit/phpunit/phpunit
./phpqa tools
bin/ci.sh
if [[ ${CI_PHP_VERSION:0:3} == "7.4" ]]; then
# TODO: revert when phpcpd v6 is supported
./phpqa --config tests/.ci --tools "phpmetrics:0,phploc,phpcs:0,php-cs-fixer,phpmd:0,pdepend,phpcpd,phpstan,phpunit:0,psalm,security-checker,parallel-lint:0"
elif [[ ${CI_PHP_VERSION:0:3} == "8" ]]; then
# TODO: enable phpqa when robo v2 is supported
mkdir -p build
else
bin/ci.sh
fi
ls -lAh build

- name: Upload QA files
uses: actions/upload-artifact@v2
with:
name: phpqa-${{ matrix.php }}
path: build

# DEPRECATED TRAVIS
#deploy:
# - provider: script
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Analyze PHP code with one command.
[![License](https://poser.pugx.org/edgedesign/phpqa/license)](https://packagist.org/packages/edgedesign/phpqa)
[![Latest Stable Version](https://poser.pugx.org/edgedesign/phpqa/v/stable)](/CHANGELOG.md)
[![Total Downloads](https://poser.pugx.org/edgedesign/phpqa/downloads)](https://packagist.org/packages/edgedesign/phpqa)
[![Build Status](https://github.com/EdgedesignCZ/phpqa/workflows/PHPQA%20CI/badge.svg?branch=master)](https://github.com/EdgedesignCZ/phpqa/actions)
[![Windows status](https://ci.appveyor.com/api/projects/status/t9f05uk4cjcg294o?svg=true&passingText=Windows)](https://ci.appveyor.com/project/zdenekdrahos/phpqa)

## Requirements
Expand Down
1 change: 1 addition & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ environment:
matrix:
- php_version: 7.2.20

skip_branch_with_pr: true
branches:
except:
- gh-pages
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"jakub-onderka/php-console-highlighter": "Colored output in parallel-lint"
},
"require-dev": {
"hamcrest/hamcrest-php": "*",
"hamcrest/hamcrest-php": ">=2.0.1",
"phpunit/phpunit": "~4.8.28"
},
"autoload": {
Expand All @@ -54,7 +54,7 @@
},
"autoload-dev": {
"files": [
"tests/phpunit-compatibility.php",
"tests/.phpunit/fix-testcase.php",
"vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest.php"
]
},
Expand Down
25 changes: 13 additions & 12 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
21 changes: 21 additions & 0 deletions tests/.phpunit/fix-typehints.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

$files = [
'OptionsTest.php',
'Report/ReportTest.php',
];
foreach ($files as $file) {
$path = __DIR__ . "/../{$file}";
$compatiblePhp = str_replace(
[
'function setUp()',
'function tearDown()',
],
[
'function setUp(): void',
'function tearDown(): void',
],
file_get_contents($path)
);
file_put_contents($path, $compatiblePhp);
}