Skip to content

Commit

Permalink
CI: switch to GitHub Actions - step 1: phpstan
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jrfnl committed Dec 20, 2020
1 parent 9bcb29c commit 63fd430
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 16 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: PHPStan

on:
# Run on all pushes and on all pull requests.
# Prevent the build from running when there are only irrelevant changes.
push:
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'

jobs:
phpstan:
name: "PHP: 7.4 | PHPStan"

runs-on: "ubuntu-latest"

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
coverage: none

- name: 'Composer: require PHPStan'
run: composer require --no-update --dev phpstan/phpstan

# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-composer-dependencies
- name: Install Composer dependencies
uses: "ramsey/composer-install@v1"

- name: Run PHPStan
run: vendor/bin/phpstan analyse --configuration=phpstan.neon
16 changes: 0 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,23 +76,7 @@ jobs:
- diff -B ./src/Standards/Squiz/ruleset.xml <(xmllint --format "./src/Standards/Squiz/ruleset.xml")
- diff -B ./src/Standards/Zend/ruleset.xml <(xmllint --format "./src/Standards/Zend/ruleset.xml")

# Build running just and only PHPStan.
- php: 7.4
name: "PHP: 7.4 | PHPStan"
env: PHPSTAN=1
addons:
apt:
packages:
- libonig-dev
before_install:
- phpenv config-rm xdebug.ini || echo 'No xdebug config.'
script:
- composer require --dev phpstan/phpstan
- php vendor/bin/phpstan analyse --configuration=phpstan.neon

allow_failures:
- php: 7.4
env: PHPSTAN=1
- php: nightly

before_install:
Expand Down

0 comments on commit 63fd430

Please sign in to comment.