Skip to content

Commit 185bf76

Browse files
committedDec 13, 2020
Use GitHub Actions instead of Travis CI
1 parent 46f7b3d commit 185bf76

File tree

8 files changed

+193
-41
lines changed

8 files changed

+193
-41
lines changed
 

‎.github/workflows/build.yml

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
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+
exclude:
93+
- php-version: "7.1"
94+
dependencies: "highest"
95+
96+
steps:
97+
- name: "Checkout"
98+
uses: "actions/checkout@v2"
99+
100+
- name: "Install PHP"
101+
uses: "shivammathur/setup-php@v2"
102+
with:
103+
coverage: "none"
104+
php-version: "${{ matrix.php-version }}"
105+
106+
- name: "Install lowest dependencies"
107+
if: ${{ matrix.dependencies == 'lowest' }}
108+
run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest"
109+
110+
- name: "Install highest dependencies"
111+
if: ${{ matrix.dependencies == 'highest' }}
112+
run: "composer update --no-interaction --no-progress --no-suggest"
113+
114+
- name: "Update PHPUnit"
115+
if: matrix.php-version == '7.4' || matrix.php-version == '8.0'
116+
run: "composer require --dev phpunit/phpunit:'^9.5' --update-with-dependencies"
117+
118+
- name: "Tests"
119+
run: "vendor/bin/phing tests"
120+
121+
static-analysis:
122+
name: "PHPStan"
123+
runs-on: "ubuntu-latest"
124+
125+
strategy:
126+
fail-fast: false
127+
matrix:
128+
php-version:
129+
- "7.1"
130+
- "7.2"
131+
- "7.3"
132+
- "7.4"
133+
- "8.0"
134+
dependencies:
135+
- "lowest"
136+
- "highest"
137+
138+
steps:
139+
- name: "Checkout"
140+
uses: "actions/checkout@v2"
141+
142+
- name: "Install PHP"
143+
uses: "shivammathur/setup-php@v2"
144+
with:
145+
coverage: "none"
146+
php-version: "${{ matrix.php-version }}"
147+
extensions: mbstring
148+
tools: composer:v2
149+
150+
- name: "Install lowest dependencies"
151+
if: ${{ matrix.dependencies == 'lowest' }}
152+
run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest"
153+
154+
- name: "Install highest dependencies"
155+
if: ${{ matrix.dependencies == 'highest' }}
156+
run: "composer update --no-interaction --no-progress --no-suggest"
157+
158+
- name: "Update PHPUnit"
159+
if: matrix.php-version == '7.4' || matrix.php-version == '8.0'
160+
run: "composer require --dev phpunit/phpunit:'^9.5' --update-with-dependencies"
161+
162+
- name: "PHPStan"
163+
run: "vendor/bin/phing phpstan"

‎.travis.yml

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

‎README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# PHPStan Symfony Framework extensions and rules
22

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

‎build-cs/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/composer.lock
2+
/vendor

‎build-cs/composer.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"require-dev": {
3+
"consistence/coding-standard": "^3.10",
4+
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
5+
"slevomat/coding-standard": "^6.4"
6+
}
7+
}

‎build.xml

Lines changed: 13 additions & 16 deletions
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,19 +20,6 @@
2120
</exec>
2221
</target>
2322

24-
<target name="composer-normalize-check">
25-
<exec
26-
executable="composer"
27-
logoutput="true"
28-
passthru="true"
29-
checkreturn="true"
30-
>
31-
<arg value="normalize"/>
32-
<arg value="--ansi"/>
33-
<arg value="--dry-run"/>
34-
</exec>
35-
</target>
36-
3723
<target name="lint">
3824
<exec
3925
executable="vendor/bin/parallel-lint"
@@ -47,8 +33,19 @@
4733
</target>
4834

4935
<target name="cs">
36+
<exec
37+
executable="composer"
38+
logoutput="true"
39+
passthru="true"
40+
checkreturn="true"
41+
>
42+
<arg value="install"/>
43+
<arg value="--working-dir"/>
44+
<arg path="build-cs"/>
45+
<arg value="--ansi"/>
46+
</exec>
5047
<exec
51-
executable="vendor/bin/phpcs"
48+
executable="build-cs/vendor/bin/phpcs"
5249
logoutput="true"
5350
passthru="true"
5451
checkreturn="true"
@@ -64,7 +61,7 @@
6461

6562
<target name="cs-fix">
6663
<exec
67-
executable="vendor/bin/phpcbf"
64+
executable="build-cs/vendor/bin/phpcbf"
6865
logoutput="true"
6966
passthru="true"
7067
checkreturn="true"

‎composer.json

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,21 @@
2121
"symfony/framework-bundle": "<3.0"
2222
},
2323
"require-dev": {
24-
"consistence/coding-standard": "^3.10",
25-
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
26-
"ergebnis/composer-normalize": "^2.0.2",
27-
"phing/phing": "^2.16.2",
24+
"phing/phing": "^2.16.3",
2825
"php-parallel-lint/php-parallel-lint": "^1.2",
29-
"phpstan/phpstan-phpunit": "^0.12.8",
30-
"phpstan/phpstan-strict-rules": "^0.12.2",
26+
"phpstan/phpstan-phpunit": "^0.12.16",
27+
"phpstan/phpstan-strict-rules": "^0.12.5",
3128
"phpunit/phpunit": "^7.5.20",
32-
"slevomat/coding-standard": "^6.4",
33-
"squizlabs/php_codesniffer": "^3.5.6",
3429
"symfony/console": "^4.0",
3530
"symfony/framework-bundle": "^4.0",
3631
"symfony/http-foundation": "^4.0",
3732
"symfony/messenger": "^4.2",
3833
"symfony/serializer": "^4.0"
3934
},
4035
"config": {
36+
"platform": {
37+
"php": "7.4.6"
38+
},
4139
"sort-packages": true
4240
},
4341
"extra": {

‎phpcs.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0"?>
22
<ruleset name="PHPStan PHPUnit extensions and rules">
3-
<rule ref="vendor/consistence/coding-standard/Consistence/ruleset.xml">
3+
<rule ref="build-cs/vendor/consistence/coding-standard/Consistence/ruleset.xml">
44
<exclude name="Squiz.Functions.GlobalFunction.Found"/>
55
<exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameAfterKeyword"/>
66
<exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameInAnnotation"/>

0 commit comments

Comments
 (0)
Please sign in to comment.