Skip to content

Commit

Permalink
Ditch Travis to use GitHub Actions
Browse files Browse the repository at this point in the history
But keep it only for PHP 8 because GA doesn't have an "allow failure"
feature
  • Loading branch information
j0k3r committed Nov 26, 2020
1 parent 38f9b9f commit 02103d9
Show file tree
Hide file tree
Showing 6 changed files with 440 additions and 46 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ insert_final_newline = false
[*.html]
insert_final_newline = false
trim_trailing_whitespace = false

[.github/**.yml]
indent_size = 2
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/.github export-ignore
/tests export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.php_cs export-ignore
/.scrutinizer.yml export-ignore
/.travis.yml export-ignore
/phpunit.xml export-ignore
/tests export-ignore
/phpstan.neon export-ignore
56 changes: 56 additions & 0 deletions .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: "CS"

on:
pull_request:
branches:
- master
push:
branches:
- master

jobs:
coding-standards:
name: "CS Fixer & PHPStan"
runs-on: "ubuntu-18.04"

strategy:
matrix:
php:
- "7.3"

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

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php }}"
tools: cs2pr, composer:v1
ini-values: "date.timezone=Europe/Paris"
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: "Cache dependencies installed with Composer"
uses: "actions/cache@v2"
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: "php-${{ matrix.php }}-composer-locked-${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php }}-composer-locked-"

- name: "Install dependencies with Composer"
run: "composer install --no-interaction --optimize-autoloader --no-progress --prefer-dist"

- name: "Run PHP CS Fixer"
run: "php vendor/bin/php-cs-fixer fix --verbose --dry-run --format=checkstyle | cs2pr"

- name: "Install PHPUnit for PHPStan"
run: "php vendor/bin/simple-phpunit install"

- name: "Run PHPStan"
run: "php vendor/bin/phpstan analyse --no-progress --error-format=checkstyle | cs2pr"
Loading

0 comments on commit 02103d9

Please sign in to comment.