Skip to content

Commit 495bae6

Browse files
authored
Merge pull request #112 from diablomedia/php-81
testing php 8.1
1 parent 8b159a5 commit 495bae6

File tree

9 files changed

+85
-76
lines changed

9 files changed

+85
-76
lines changed

.github/workflows/build.yml

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,14 @@ jobs:
1313
fail-fast: false
1414
matrix:
1515
operating-system: [ubuntu-latest]
16-
php-versions: ['7.2', '7.3', '7.4']
16+
php-versions: ['7.4', '8.0', '8.1']
1717
composer-args: ['', '--prefer-lowest']
18-
include:
19-
- operating-system: ubuntu-latest
20-
php-versions: '8.0'
21-
composer-args: '--ignore-platform-reqs --no-scripts'
22-
- operating-system: ubuntu-latest
23-
php-versions: '8.0'
24-
composer-args: '--prefer-lowest --ignore-platform-reqs --no-scripts'
2518
runs-on: ${{ matrix.operating-system }}
2619
steps:
2720
- name: Checkout
28-
uses: actions/checkout@v2.3.4
21+
uses: actions/checkout@v2.4.0
2922
- name: Setup PHP
30-
uses: shivammathur/setup-php@2.10.0
23+
uses: shivammathur/setup-php@2.16.0
3124
with:
3225
php-version: ${{ matrix.php-versions }}
3326
extensions: mbstring
@@ -39,7 +32,7 @@ jobs:
3932
id: composer-cache
4033
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
4134
- name: Cache dependencies
42-
uses: actions/[email protected].4
35+
uses: actions/[email protected].7
4336
with:
4437
path: ${{ steps.composer-cache.outputs.dir }}
4538
key: php${{ matrix.php-versions }}-composer-${{ matrix.composer-args }}-${{ hashFiles('**/composer.json') }}
@@ -50,21 +43,14 @@ jobs:
5043
- name: PHPStan
5144
run: composer phpstan
5245
- name: Code Style Check
46+
env:
47+
PHP_CS_FIXER_IGNORE_ENV: true
5348
run: composer style-check -- --format=checkstyle | cs2pr
5449
- name: Test
5550
run: composer test-with-coverage
5651
- name: Upload Coverage
57-
run: bash <(curl -s https://codecov.io/bash) -f ./clover.xml
58-
merge-me:
59-
name: Merge me!
60-
needs:
61-
- build
62-
runs-on: ubuntu-latest
63-
steps:
64-
- name: Merge me!
65-
uses: ridedott/merge-me-action@master
52+
uses: codecov/codecov-action@v2
6653
with:
67-
# This must be used as GitHub Actions token does not support
68-
# pushing to protected branches.
69-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70-
GITHUB_LOGIN: 'dependabot[bot]'
54+
files: ./clover.xml
55+
fail_ci_if_error: true
56+
verbose: true

.github/workflows/merge-me.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Merge me!
2+
3+
on:
4+
workflow_run:
5+
types:
6+
- completed
7+
workflows:
8+
- 'Build'
9+
10+
jobs:
11+
merge-me:
12+
name: Merge me!
13+
runs-on: ubuntu-latest
14+
steps:
15+
- # It is often a desired behavior to merge only when a workflow execution
16+
# succeeds. This can be changed as needed.
17+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
18+
name: Merge me!
19+
uses: ridedott/merge-me-action@v2
20+
with:
21+
# Depending on branch protection rules, a manually populated
22+
# `GITHUB_TOKEN_WORKAROUND` secret with permissions to push to
23+
# a protected branch must be used. This secret can have an arbitrary
24+
# name, as an example, this repository uses `DOTTBOTT_TOKEN`.
25+
#
26+
# When using a custom token, it is recommended to leave the following
27+
# comment for other developers to be aware of the reasoning behind it:
28+
#
29+
# This must be used as GitHub Actions token does not support pushing
30+
# to protected branches.
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
ENABLE_GITHUB_API_PREVIEW: true

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
/clover.xml
44
.php_cs.cache
55
.phpunit.result.cache
6+
.php-cs-fixer.cache

.php-cs-fixer.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
$finder = PhpCsFixer\Finder::create()
4+
->exclude('vendor')
5+
->files()
6+
->in(__DIR__)
7+
;
8+
9+
$config = new PhpCsFixer\Config();
10+
return $config->setRiskyAllowed(true)
11+
->setRules(array(
12+
'@PSR2' => true,
13+
'@PHPUnit60Migration:risky' => true,
14+
'binary_operator_spaces' => array('operators' => array('=' => 'align', '=>' => 'align')),
15+
'single_quote' => true,
16+
'array_syntax' => array('syntax' => 'long'),
17+
'concat_space' => array('spacing' => 'one'),
18+
'psr_autoloading' => array('dir' => 'src'),
19+
))
20+
->setUsingCache(true)
21+
->setFinder($finder);
22+
;

.php_cs

Lines changed: 0 additions & 26 deletions
This file was deleted.

composer.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"license": "BSD-3-Clause",
1111
"prefer-stable": true,
1212
"require": {
13-
"php": "^7.0 || ^8.0",
13+
"php": "^7.4 || ~8.0.0 || ~8.1.0",
1414
"diablomedia/zendframework1-validate": "^1.0.0",
1515
"diablomedia/zendframework1-uri": "^1.0.0"
1616
},
@@ -25,11 +25,11 @@
2525
}
2626
},
2727
"require-dev": {
28-
"phpunit/phpunit": "^8.0",
29-
"phpstan/phpstan": "0.12.82",
30-
"friendsofphp/php-cs-fixer": "2.18.4",
31-
"maglnet/composer-require-checker": "^1.1.0 || ^2.0.0",
32-
"phpro/grumphp-shim": "^0.22.0 || ^1.1"
28+
"phpunit/phpunit": "^9.5.10",
29+
"phpstan/phpstan": "1.2.0",
30+
"friendsofphp/php-cs-fixer": "3.3.2",
31+
"maglnet/composer-require-checker": "^3.0.0",
32+
"phpro/grumphp-shim": "^1.5.0"
3333
},
3434
"include-path": [
3535
"src/"

grumphp.yml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ grumphp:
66
composer_require_checker: ~
77
phpcsfixer2:
88
allow_risky: true
9-
config: .php_cs
9+
config: .php-cs-fixer.php
1010
phpstan:
1111
configuration: phpstan.neon
1212
phpunit:

phpstan.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ parameters:
33
level: 8
44
paths:
55
- ./
6-
excludes_analyse:
6+
excludePaths:
77
- %rootDir%/../../../vendor/*
88
- %rootDir%/../../../tests/*
99
ignoreErrors:

phpunit.xml.dist

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
1-
<phpunit
2-
convertErrorsToExceptions="true"
3-
convertNoticesToExceptions="true"
4-
convertWarningsToExceptions="true"
5-
beStrictAboutTestsThatDoNotTestAnything="true"
6-
backupGlobals="true"
7-
stderr="true"
8-
colors="true">
9-
<testsuites>
10-
<testsuite name="default">
11-
<directory>./tests</directory>
12-
</testsuite>
13-
</testsuites>
14-
<filter>
15-
<whitelist addUncoveredFilesFromWhitelist="true">
16-
<directory suffix=".php">./src</directory>
17-
</whitelist>
18-
</filter>
1+
<?xml version="1.0"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" beStrictAboutTestsThatDoNotTestAnything="true" backupGlobals="true" stderr="true" colors="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
3+
<coverage includeUncoveredFiles="true">
4+
<include>
5+
<directory suffix=".php">./src</directory>
6+
</include>
7+
</coverage>
8+
<testsuites>
9+
<testsuite name="default">
10+
<directory>./tests</directory>
11+
</testsuite>
12+
</testsuites>
1913
</phpunit>

0 commit comments

Comments
 (0)