Skip to content

Commit c3b6ef5

Browse files
committed
Use GitHub Actions instead of Travis CI
1 parent 9c79941 commit c3b6ef5

File tree

8 files changed

+241
-109
lines changed

8 files changed

+241
-109
lines changed

.github/workflows/build.yml

+160
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
2+
3+
name: "Build"
4+
5+
on:
6+
pull_request:
7+
push:
8+
branches:
9+
- "master"
10+
11+
jobs:
12+
lint:
13+
name: "Lint"
14+
runs-on: "ubuntu-latest"
15+
16+
strategy:
17+
matrix:
18+
php-version:
19+
- "7.1"
20+
- "7.2"
21+
- "7.3"
22+
- "7.4"
23+
- "8.0"
24+
25+
steps:
26+
- name: "Checkout"
27+
uses: "actions/checkout@v2"
28+
29+
- name: "Install PHP"
30+
uses: "shivammathur/setup-php@v2"
31+
with:
32+
coverage: "none"
33+
php-version: "${{ matrix.php-version }}"
34+
35+
- name: "Validate Composer"
36+
run: "composer validate"
37+
38+
- name: "Install dependencies"
39+
run: "composer install --no-interaction --no-progress --no-suggest"
40+
41+
- name: "Update PHPUnit"
42+
if: matrix.php-version == '7.4' || matrix.php-version == '8.0'
43+
run: "composer require --dev phpunit/phpunit:'^9.5' --update-with-dependencies"
44+
45+
46+
- name: "Lint"
47+
run: "vendor/bin/phing lint"
48+
49+
coding-standards:
50+
name: "Coding Standard"
51+
52+
runs-on: "ubuntu-latest"
53+
54+
steps:
55+
- name: "Checkout"
56+
uses: "actions/checkout@v2"
57+
58+
- name: "Install PHP"
59+
uses: "shivammathur/setup-php@v2"
60+
with:
61+
coverage: "none"
62+
php-version: "7.4"
63+
64+
- name: "Validate Composer"
65+
run: "composer validate"
66+
67+
- name: "Install dependencies"
68+
run: "composer install --no-interaction --no-progress --no-suggest"
69+
70+
- name: "Lint"
71+
run: "vendor/bin/phing lint"
72+
73+
- name: "Coding Standard"
74+
run: "vendor/bin/phing cs"
75+
76+
tests:
77+
name: "Tests"
78+
runs-on: "ubuntu-latest"
79+
80+
strategy:
81+
fail-fast: false
82+
matrix:
83+
php-version:
84+
- "7.1"
85+
- "7.2"
86+
- "7.3"
87+
- "7.4"
88+
- "8.0"
89+
dependencies:
90+
- "lowest"
91+
- "highest"
92+
93+
steps:
94+
- name: "Checkout"
95+
uses: "actions/checkout@v2"
96+
97+
- name: "Install PHP"
98+
uses: "shivammathur/setup-php@v2"
99+
with:
100+
coverage: "none"
101+
php-version: "${{ matrix.php-version }}"
102+
103+
- name: "Install lowest dependencies"
104+
if: ${{ matrix.dependencies == 'lowest' }}
105+
run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest"
106+
107+
- name: "Install highest dependencies"
108+
if: ${{ matrix.dependencies == 'highest' }}
109+
run: "composer update --no-interaction --no-progress --no-suggest"
110+
111+
- name: "Update PHPUnit"
112+
if: matrix.php-version == '7.4' || matrix.php-version == '8.0'
113+
run: "composer require --dev phpunit/phpunit:'^9.5' --update-with-dependencies"
114+
115+
- name: "Tests"
116+
run: "vendor/bin/phing tests"
117+
118+
static-analysis:
119+
name: "PHPStan"
120+
runs-on: "ubuntu-latest"
121+
122+
strategy:
123+
fail-fast: false
124+
matrix:
125+
php-version:
126+
- "7.1"
127+
- "7.2"
128+
- "7.3"
129+
- "7.4"
130+
- "8.0"
131+
dependencies:
132+
- "lowest"
133+
- "highest"
134+
135+
steps:
136+
- name: "Checkout"
137+
uses: "actions/checkout@v2"
138+
139+
- name: "Install PHP"
140+
uses: "shivammathur/setup-php@v2"
141+
with:
142+
coverage: "none"
143+
php-version: "${{ matrix.php-version }}"
144+
extensions: mbstring
145+
tools: composer:v2
146+
147+
- name: "Install lowest dependencies"
148+
if: ${{ matrix.dependencies == 'lowest' }}
149+
run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest"
150+
151+
- name: "Install highest dependencies"
152+
if: ${{ matrix.dependencies == 'highest' }}
153+
run: "composer update --no-interaction --no-progress --no-suggest"
154+
155+
- name: "Update PHPUnit"
156+
if: matrix.php-version == '7.4' || matrix.php-version == '8.0'
157+
run: "composer require --dev phpunit/phpunit:'^9.5' --update-with-dependencies"
158+
159+
- name: "PHPStan"
160+
run: "vendor/bin/phing phpstan"

.travis.yml

-15
This file was deleted.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# PHPStan Mockery extension
22

3-
[![Build Status](https://travis-ci.com/phpstan/phpstan-mockery.svg?branch=master)](https://travis-ci.com/phpstan/phpstan-mockery)
3+
[![Build](https://github.com/phpstan/phpstan-mockery/workflows/Build/badge.svg)](https://github.com/phpstan/phpstan-mockery/actions)
44
[![Latest Stable Version](https://poser.pugx.org/phpstan/phpstan-mockery/v/stable)](https://packagist.org/packages/phpstan/phpstan-mockery)
55
[![License](https://poser.pugx.org/phpstan/phpstan-mockery/license)](https://packagist.org/packages/phpstan/phpstan-mockery)
66

build-cs/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/composer.lock
2+
/vendor

build-cs/composer.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"require-dev": {
3+
"consistence/coding-standard": "^3.5",
4+
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
5+
"slevomat/coding-standard": "^4.7.2",
6+
"squizlabs/php_codesniffer": "^3.3.2"
7+
}
8+
}

build.xml

+23-44
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
composer,
66
lint,
77
cs,
8-
composer-normalize-check,
98
tests,
109
phpstan
1110
"/>
@@ -21,69 +20,49 @@
2120
</exec>
2221
</target>
2322

24-
<target name="composer-normalize-check">
23+
<target name="lint">
2524
<exec
26-
executable="composer"
27-
logoutput="true"
28-
passthru="true"
29-
checkreturn="true"
25+
executable="vendor/bin/parallel-lint"
26+
logoutput="true"
27+
passthru="true"
28+
checkreturn="true"
3029
>
31-
<arg value="normalize"/>
32-
<arg value="--ansi"/>
33-
<arg value="--dry-run"/>
30+
<arg path="src" />
31+
<arg path="tests" />
3432
</exec>
3533
</target>
3634

37-
<target name="composer-normalize-fix">
35+
<target name="cs">
3836
<exec
3937
executable="composer"
4038
logoutput="true"
4139
passthru="true"
4240
checkreturn="true"
4341
>
44-
<arg value="normalize"/>
42+
<arg value="install"/>
43+
<arg value="--working-dir"/>
44+
<arg path="build-cs"/>
4545
<arg value="--ansi"/>
4646
</exec>
47-
</target>
48-
49-
<target name="lint">
5047
<exec
51-
executable="vendor/bin/parallel-lint"
52-
logoutput="true"
53-
passthru="true"
54-
checkreturn="true"
48+
executable="build-cs/vendor/bin/phpcs"
49+
logoutput="true"
50+
passthru="true"
51+
checkreturn="true"
5552
>
56-
<arg path="src" />
57-
<arg path="tests" />
53+
<arg value="--colors"/>
54+
<arg value="--extensions=php"/>
55+
<arg value="--encoding=utf-8"/>
56+
<arg value="--tab-width=4"/>
57+
<arg value="-sp"/>
58+
<arg path="src"/>
59+
<arg path="tests"/>
5860
</exec>
5961
</target>
6062

61-
<target name="cs">
62-
<php expression="PHP_VERSION_ID &gt;= 70400 ?'true':'false'" returnProperty="isPHP74" level="verbose" />
63-
<if>
64-
<equals arg1="${isPHP74}" arg2="false" />
65-
<then>
66-
<exec
67-
executable="vendor/bin/phpcs"
68-
logoutput="true"
69-
passthru="true"
70-
checkreturn="true"
71-
>
72-
<arg value="--colors"/>
73-
<arg value="--extensions=php"/>
74-
<arg value="--encoding=utf-8"/>
75-
<arg value="--tab-width=4"/>
76-
<arg value="-sp"/>
77-
<arg path="src"/>
78-
<arg path="tests"/>
79-
</exec>
80-
</then>
81-
</if>
82-
</target>
83-
8463
<target name="cs-fix">
8564
<exec
86-
executable="vendor/bin/phpcbf"
65+
executable="build-cs/vendor/bin/phpcbf"
8766
logoutput="true"
8867
passthru="true"
8968
checkreturn="true"

composer.json

+46-48
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,48 @@
11
{
2-
"name": "phpstan/phpstan-mockery",
3-
"type": "phpstan-extension",
4-
"description": "PHPStan Mockery extension",
5-
"license": [
6-
"MIT"
7-
],
8-
"require": {
9-
"php": "^7.1 || ^8.0",
10-
"phpstan/phpstan": "^0.12"
11-
},
12-
"require-dev": {
13-
"consistence/coding-standard": "^3.5",
14-
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
15-
"ergebnis/composer-normalize": "^2.0.2",
16-
"mockery/mockery": "^1.2.4",
17-
"phing/phing": "^2.16.0",
18-
"php-parallel-lint/php-parallel-lint": "^1.2",
19-
"phpstan/phpstan-phpunit": "^0.12",
20-
"phpstan/phpstan-strict-rules": "^0.12",
21-
"phpunit/phpunit": "^7.2",
22-
"slevomat/coding-standard": "^4.7.2",
23-
"squizlabs/php_codesniffer": "^3.3.2"
24-
},
25-
"config": {
26-
"sort-packages": true
27-
},
28-
"extra": {
29-
"branch-alias": {
30-
"dev-master": "0.12-dev"
31-
},
32-
"phpstan": {
33-
"includes": [
34-
"extension.neon"
35-
]
36-
}
37-
},
38-
"autoload": {
39-
"psr-4": {
40-
"PHPStan\\": "src/"
41-
}
42-
},
43-
"autoload-dev": {
44-
"classmap": [
45-
"tests/"
46-
]
47-
},
48-
"minimum-stability": "dev",
49-
"prefer-stable": true
2+
"name": "phpstan/phpstan-mockery",
3+
"type": "phpstan-extension",
4+
"description": "PHPStan Mockery extension",
5+
"license": [
6+
"MIT"
7+
],
8+
"require": {
9+
"php": "^7.1 || ^8.0",
10+
"phpstan/phpstan": "^0.12.60"
11+
},
12+
"require-dev": {
13+
"mockery/mockery": "^1.2.4",
14+
"phing/phing": "^2.16.3",
15+
"php-parallel-lint/php-parallel-lint": "^1.2",
16+
"phpstan/phpstan-phpunit": "^0.12.16",
17+
"phpstan/phpstan-strict-rules": "^0.12.5",
18+
"phpunit/phpunit": "^7.5.20"
19+
},
20+
"config": {
21+
"platform": {
22+
"php": "7.4.6"
23+
},
24+
"sort-packages": true
25+
},
26+
"extra": {
27+
"branch-alias": {
28+
"dev-master": "0.12-dev"
29+
},
30+
"phpstan": {
31+
"includes": [
32+
"extension.neon"
33+
]
34+
}
35+
},
36+
"autoload": {
37+
"psr-4": {
38+
"PHPStan\\": "src/"
39+
}
40+
},
41+
"autoload-dev": {
42+
"classmap": [
43+
"tests/"
44+
]
45+
},
46+
"minimum-stability": "dev",
47+
"prefer-stable": true
5048
}

0 commit comments

Comments
 (0)