Skip to content

Commit 05cc730

Browse files
authored
Merge pull request #223 from Masterminds/gh-actions
GH actions
2 parents 5e0edf3 + 530a9f2 commit 05cc730

File tree

8 files changed

+119
-45
lines changed

8 files changed

+119
-45
lines changed

.github/workflows/benchmark.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Benchmarks
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
phpbench:
11+
name: "PHPBench"
12+
runs-on: "ubuntu-20.04"
13+
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
php-version:
18+
- "5.4"
19+
- "7.4"
20+
- "8.2"
21+
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v2
25+
26+
- name: Setup PHP
27+
uses: shivammathur/setup-php@v2
28+
with:
29+
php-version: ${{ matrix.php-version }}
30+
31+
- name: "Install dependencies with Composer"
32+
uses: "ramsey/composer-install@v2"
33+
34+
- name: Run performance tests
35+
run: |
36+
php test/benchmark/run.php 10

.github/workflows/ci.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
phpunit:
11+
name: "PHPUnit"
12+
runs-on: "ubuntu-20.04"
13+
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
php-version:
18+
- "5.3"
19+
- "5.4"
20+
- "7.4"
21+
- "8.0"
22+
- "8.1"
23+
- "8.2"
24+
25+
steps:
26+
- name: Checkout code
27+
uses: actions/checkout@v2
28+
29+
- name: Setup PHP
30+
uses: shivammathur/setup-php@v2
31+
with:
32+
php-version: ${{ matrix.php-version }}
33+
34+
- name: "Install dependencies with Composer"
35+
uses: "ramsey/composer-install@v2"
36+
37+
- name: Run tests
38+
run: vendor/bin/phpunit

.github/workflows/cs.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: CS
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
php-cs-fixer:
11+
name: "php-cs-fixer"
12+
runs-on: "ubuntu-20.04"
13+
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
php-version:
18+
- "7.1"
19+
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v2
23+
24+
- name: Setup PHP
25+
uses: shivammathur/setup-php@v2
26+
with:
27+
php-version: ${{ matrix.php-version }}
28+
29+
- name: cs fix
30+
run: |
31+
wget -q https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v2.13.1/php-cs-fixer.phar
32+
php php-cs-fixer.phar fix --dry-run --diff

.scrutinizer.yml

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

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"php" : ">=5.3.0"
2626
},
2727
"require-dev": {
28-
"phpunit/phpunit" : "^4.8.35 || ^5.7.21 || ^6 || ^7"
28+
"phpunit/phpunit" : "^4.8.35 || ^5.7.21 || ^6 || ^7 || ^8"
2929
},
3030
"autoload": {
3131
"psr-4": {"Masterminds\\": "src"}

test/HTML5/Html5Test.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ class Html5Test extends TestCase
1111
*/
1212
private $html5;
1313

14-
public function setUp()
14+
/**
15+
* @before
16+
*/
17+
public function before()
1518
{
1619
$this->html5 = $this->getInstance();
1720
}

test/HTML5/Serializer/OutputRulesTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ class OutputRulesTest extends \Masterminds\HTML5\Tests\TestCase
2424
*/
2525
protected $html5;
2626

27-
public function setUp()
27+
/**
28+
* @before
29+
*/
30+
public function before()
2831
{
2932
$this->html5 = $this->getInstance();
3033
}

test/HTML5/Serializer/TraverserTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ class TraverserTest extends \Masterminds\HTML5\Tests\TestCase
1818
</body>
1919
</html>';
2020

21-
public function setUp()
21+
/**
22+
* @before
23+
*/
24+
public function before()
2225
{
2326
$this->html5 = $this->getInstance();
2427
}

0 commit comments

Comments
 (0)