Skip to content

Commit 9ca90a4

Browse files
authored
Merge pull request #22 from jakzal/build-fix
Fix the build
2 parents 26a0bf3 + c8ad8db commit 9ca90a4

File tree

4 files changed

+31
-26
lines changed

4 files changed

+31
-26
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ jobs:
3434

3535
- name: Test & package
3636
if: matrix.deps == 'high'
37-
run: make install test -o cs
37+
run: make install test
3838

39-
# Separate CS and package step until PHP 8.0 is supported
39+
# Separate package step until PHP 8.0 is supported
4040
- name: Coding standards
4141
if: matrix.php != '8.0'
42-
run: make cs package
42+
run: make package
4343

4444
- name: Test & package (min)
4545
if: matrix.deps == 'low'

Makefile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
IS_PHP8:=$(shell php -r 'echo (int)version_compare(PHP_VERSION, "8.0", ">=");')
2+
13
default: build
24

35
build: install test
@@ -29,12 +31,20 @@ test-package: test-package-tools
2931
cd tests/phar && ./tools/phpunit
3032
.PHONY: test-package
3133

34+
ifeq ($(IS_PHP8),1)
35+
cs:
36+
else
3237
cs: tools/php-cs-fixer
3338
tools/php-cs-fixer --dry-run --allow-risky=yes --no-interaction --ansi fix
39+
endif
3440
.PHONY: cs
3541

42+
ifeq ($(IS_PHP8),1)
43+
cs-fix:
44+
else
3645
cs-fix: tools/php-cs-fixer
3746
tools/php-cs-fixer --allow-risky=yes --no-interaction --ansi fix
47+
endif
3848
.PHONY: cs-fix
3949

4050
phpunit: tools/phpunit
@@ -81,13 +91,13 @@ tools/php-cs-fixer:
8191
curl -Ls http://cs.sensiolabs.org/download/php-cs-fixer-v2.phar -o tools/php-cs-fixer && chmod +x tools/php-cs-fixer
8292

8393
tools/box:
84-
curl -Ls https://github.com/humbug/box/releases/download/3.8.4/box.phar -o tools/box && chmod +x tools/box
94+
curl -Ls https://github.com/humbug/box/releases/download/3.10.0/box.phar -o tools/box && chmod +x tools/box
8595

8696
test-package-tools: tests/phar/tools/phpunit tests/phar/tools/phpunit.d/zalas-phpunit-globals-extension.phar
8797
.PHONY: test-package-tools
8898

8999
tests/phar/tools/phpunit:
90-
curl -Ls https://phar.phpunit.de/phpunit-9.phar -o tests/phar/tools/phpunit && chmod +x tests/phar/tools/phpunit
100+
curl -Ls https://phar.phpunit.de/phpunit-9.4.4.phar -o tests/phar/tools/phpunit && chmod +x tests/phar/tools/phpunit
91101

92102
tests/phar/tools/phpunit.d/zalas-phpunit-globals-extension.phar: build/zalas-phpunit-globals-extension.phar
93103
cp build/zalas-phpunit-globals-extension.phar tests/phar/tools/phpunit.d/zalas-phpunit-globals-extension.phar

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
"php": "^7.3 || ~8.0.0",
1414
"phpunit/phpunit": "^9.0"
1515
},
16+
"conflict": {
17+
"phpunit/phpunit": "9.5.0"
18+
},
1619
"autoload": {
1720
"psr-4": {
1821
"Zalas\\PHPUnit\\Globals\\": "src/"

phpunit.xml.dist

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,15 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.0/phpunit.xsd"
4-
bootstrap="vendor/autoload.php"
5-
beStrictAboutOutputDuringTests="true"
6-
beStrictAboutTodoAnnotatedTests="true"
7-
colors="true"
8-
verbose="true">
9-
<testsuite name="default">
10-
<directory suffix="Test.php">tests</directory>
11-
<exclude>tests/phar</exclude>
12-
</testsuite>
13-
14-
<filter>
15-
<whitelist processUncoveredFilesFromWhitelist="true">
16-
<directory suffix=".php">src</directory>
17-
</whitelist>
18-
</filter>
19-
20-
<extensions>
21-
<extension class="Zalas\PHPUnit\Globals\AnnotationExtension" />
22-
</extensions>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" bootstrap="vendor/autoload.php" beStrictAboutOutputDuringTests="true" beStrictAboutTodoAnnotatedTests="true" colors="true" verbose="true">
3+
<coverage processUncoveredFiles="true">
4+
<include>
5+
<directory suffix=".php">src</directory>
6+
</include>
7+
</coverage>
8+
<testsuite name="default">
9+
<directory suffix="Test.php">tests</directory>
10+
<exclude>tests/phar</exclude>
11+
</testsuite>
12+
<extensions>
13+
<extension class="Zalas\PHPUnit\Globals\AnnotationExtension"/>
14+
</extensions>
2315
</phpunit>

0 commit comments

Comments
 (0)