Skip to content

Commit 5de413b

Browse files
committed
Use GitHub Actions instead of Travis CI
1 parent 5c2da38 commit 5de413b

File tree

10 files changed

+171
-46
lines changed

10 files changed

+171
-46
lines changed

.github/workflows/build.yml

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
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: "Lint"
42+
run: "vendor/bin/phing lint"
43+
44+
coding-standards:
45+
name: "Coding Standard"
46+
47+
runs-on: "ubuntu-latest"
48+
49+
steps:
50+
- name: "Checkout"
51+
uses: "actions/checkout@v2"
52+
53+
- name: "Install PHP"
54+
uses: "shivammathur/setup-php@v2"
55+
with:
56+
coverage: "none"
57+
php-version: "7.4"
58+
59+
- name: "Validate Composer"
60+
run: "composer validate"
61+
62+
- name: "Install dependencies"
63+
run: "composer install --no-interaction --no-progress --no-suggest"
64+
65+
- name: "Lint"
66+
run: "vendor/bin/phing lint"
67+
68+
- name: "Coding Standard"
69+
run: "vendor/bin/phing cs"
70+
71+
static-analysis:
72+
name: "PHPStan"
73+
runs-on: "ubuntu-latest"
74+
75+
strategy:
76+
fail-fast: false
77+
matrix:
78+
php-version:
79+
- "7.1"
80+
- "7.2"
81+
- "7.3"
82+
- "7.4"
83+
- "8.0"
84+
dependencies:
85+
- "lowest"
86+
- "highest"
87+
88+
steps:
89+
- name: "Checkout"
90+
uses: "actions/checkout@v2"
91+
92+
- name: "Install PHP"
93+
uses: "shivammathur/setup-php@v2"
94+
with:
95+
coverage: "none"
96+
php-version: "${{ matrix.php-version }}"
97+
extensions: mbstring
98+
tools: composer:v2
99+
100+
- name: "Install lowest dependencies"
101+
if: ${{ matrix.dependencies == 'lowest' }}
102+
run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest"
103+
104+
- name: "Install highest dependencies"
105+
if: ${{ matrix.dependencies == 'highest' }}
106+
run: "composer update --no-interaction --no-progress --no-suggest"
107+
108+
- name: "Update PHPStan"
109+
if: matrix.php-version == '8.0'
110+
run: "composer require --dev phpstan/phpstan:'^0.12.60' --update-with-dependencies"
111+
112+
- name: "PHPStan"
113+
run: "vendor/bin/phing phpstan"

.github/workflows/release.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
2+
3+
name: "Create release"
4+
5+
on:
6+
push:
7+
tags:
8+
- '*'
9+
10+
jobs:
11+
deploy:
12+
name: "Deploy"
13+
runs-on: "ubuntu-latest"
14+
15+
steps:
16+
- name: "Checkout"
17+
uses: "actions/checkout@v2"
18+
19+
- name: Generate changelog
20+
id: changelog
21+
uses: metcalfc/[email protected]
22+
with:
23+
myToken: ${{ secrets.GITHUB_TOKEN }}
24+
25+
- name: "Create release"
26+
id: create-release
27+
uses: actions/create-release@v1
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
with:
31+
tag_name: ${{ github.ref }}
32+
release_name: ${{ github.ref }}
33+
body: ${{ steps.changelog.outputs.changelog }}

.travis.yml

Lines changed: 0 additions & 14 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 Extension Installer
22

3-
[![Build Status](https://travis-ci.com/phpstan/extension-installer.svg?branch=master)](https://travis-ci.com/phpstan/extension-installer)
3+
[![Build](https://github.com/phpstan/extension-installer/workflows/Build/badge.svg)](https://github.com/phpstan/extension-installer/actions)
44
[![Latest Stable Version](https://poser.pugx.org/phpstan/extension-installer/v/stable)](https://packagist.org/packages/phpstan/extension-installer)
55
[![License](https://poser.pugx.org/phpstan/extension-installer/license)](https://packagist.org/packages/phpstan/extension-installer)
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.8",
4+
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
5+
"slevomat/coding-standard": "^5.0.4"
6+
}
7+
}

build.xml

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
composer,
66
lint,
77
cs,
8-
composer-normalize-check,
98
phpstan
109
"/>
1110

@@ -20,45 +19,31 @@
2019
</exec>
2120
</target>
2221

23-
<target name="composer-normalize-check">
22+
<target name="lint">
2423
<exec
25-
executable="composer"
24+
executable="vendor/bin/parallel-lint"
2625
logoutput="true"
2726
passthru="true"
2827
checkreturn="true"
2928
>
30-
<arg value="normalize"/>
31-
<arg value="--ansi"/>
32-
<arg value="--dry-run"/>
29+
<arg path="src" />
3330
</exec>
3431
</target>
3532

36-
<target name="composer-normalize-fix">
33+
<target name="cs">
3734
<exec
3835
executable="composer"
3936
logoutput="true"
4037
passthru="true"
4138
checkreturn="true"
4239
>
43-
<arg value="normalize"/>
40+
<arg value="install"/>
41+
<arg value="--working-dir"/>
42+
<arg path="build-cs"/>
4443
<arg value="--ansi"/>
4544
</exec>
46-
</target>
47-
48-
<target name="lint">
49-
<exec
50-
executable="vendor/bin/parallel-lint"
51-
logoutput="true"
52-
passthru="true"
53-
checkreturn="true"
54-
>
55-
<arg path="src" />
56-
</exec>
57-
</target>
58-
59-
<target name="cs">
6045
<exec
61-
executable="vendor/bin/phpcs"
46+
executable="build-cs/vendor/bin/phpcs"
6247
logoutput="true"
6348
passthru="true"
6449
checkreturn="true"
@@ -73,7 +58,7 @@
7358

7459
<target name="cs-fix">
7560
<exec
76-
executable="vendor/bin/phpcbf"
61+
executable="build-cs/vendor/bin/phpcbf"
7762
logoutput="true"
7863
passthru="true"
7964
checkreturn="true"

composer.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,9 @@
1212
},
1313
"require-dev": {
1414
"composer/composer": "^1.8",
15-
"consistence/coding-standard": "^3.8",
16-
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
17-
"ergebnis/composer-normalize": "^2.0.2",
18-
"phing/phing": "^2.16",
15+
"phing/phing": "^2.16.3",
1916
"php-parallel-lint/php-parallel-lint": "^1.2.0",
20-
"phpstan/phpstan-strict-rules": "^0.11",
21-
"slevomat/coding-standard": "^5.0.4"
17+
"phpstan/phpstan-strict-rules": "^0.11 || ^0.12"
2218
},
2319
"config": {
2420
"sort-packages": true

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 Extension Installer">
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="SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration.InvalidFormat"/>
55
<exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameAfterKeyword"/>
66
<exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameInAnnotation"/>

src/Plugin.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ public function uninstall(Composer $composer, IOInterface $io): void
6262
// noop
6363
}
6464

65+
/**
66+
* @return array<string, string>
67+
*/
6568
public static function getSubscribedEvents(): array
6669
{
6770
return [

0 commit comments

Comments
 (0)