Skip to content

Commit 63fd430

Browse files
committed
CI: switch to GitHub Actions - step 1: phpstan
This commit: * Adds a GH Actions workflow for the PHPStan check which was previously run on Travis. * Removes that part of the `.travis.yml` configuration. Notes: Builds will run on all pushes and on pull requests, with the exception of those just modifying files which are irrelevant to this workflow.
1 parent 9bcb29c commit 63fd430

File tree

2 files changed

+38
-16
lines changed

2 files changed

+38
-16
lines changed

.github/workflows/phpstan.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: PHPStan
2+
3+
on:
4+
# Run on all pushes and on all pull requests.
5+
# Prevent the build from running when there are only irrelevant changes.
6+
push:
7+
paths-ignore:
8+
- '**.md'
9+
pull_request:
10+
paths-ignore:
11+
- '**.md'
12+
13+
jobs:
14+
phpstan:
15+
name: "PHP: 7.4 | PHPStan"
16+
17+
runs-on: "ubuntu-latest"
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v2
22+
23+
- name: Install PHP
24+
uses: shivammathur/setup-php@v2
25+
with:
26+
php-version: '7.4'
27+
coverage: none
28+
29+
- name: 'Composer: require PHPStan'
30+
run: composer require --no-update --dev phpstan/phpstan
31+
32+
# Install dependencies and handle caching in one go.
33+
# @link https://github.com/marketplace/actions/install-composer-dependencies
34+
- name: Install Composer dependencies
35+
uses: "ramsey/composer-install@v1"
36+
37+
- name: Run PHPStan
38+
run: vendor/bin/phpstan analyse --configuration=phpstan.neon

.travis.yml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -76,23 +76,7 @@ jobs:
7676
- diff -B ./src/Standards/Squiz/ruleset.xml <(xmllint --format "./src/Standards/Squiz/ruleset.xml")
7777
- diff -B ./src/Standards/Zend/ruleset.xml <(xmllint --format "./src/Standards/Zend/ruleset.xml")
7878

79-
# Build running just and only PHPStan.
80-
- php: 7.4
81-
name: "PHP: 7.4 | PHPStan"
82-
env: PHPSTAN=1
83-
addons:
84-
apt:
85-
packages:
86-
- libonig-dev
87-
before_install:
88-
- phpenv config-rm xdebug.ini || echo 'No xdebug config.'
89-
script:
90-
- composer require --dev phpstan/phpstan
91-
- php vendor/bin/phpstan analyse --configuration=phpstan.neon
92-
9379
allow_failures:
94-
- php: 7.4
95-
env: PHPSTAN=1
9680
- php: nightly
9781

9882
before_install:

0 commit comments

Comments
 (0)