Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 55bbbe5

Browse files
committed
Enhancement: Run PHP-CS-Fixer via GithubActions instead of Travis
1 parent 430a9f6 commit 55bbbe5

File tree

2 files changed

+57
-1
lines changed

2 files changed

+57
-1
lines changed

.github/workflows/ci.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: "CI"
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- 'master'
8+
9+
jobs:
10+
coding-standards:
11+
name: "Coding Standards"
12+
13+
runs-on: "ubuntu-latest"
14+
15+
strategy:
16+
matrix:
17+
php-version:
18+
- '7.4'
19+
20+
steps:
21+
-
22+
name: "Checkout code"
23+
uses: "actions/checkout@v2"
24+
with:
25+
ref: "${{ github.head_ref }}"
26+
27+
-
28+
name: "Install PHP with extensions"
29+
uses: "shivammathur/setup-php@v2"
30+
with:
31+
coverage: "none"
32+
php-version: "${{ matrix.php-version }}"
33+
34+
-
35+
name: "Validate composer.json"
36+
run: "composer validate"
37+
38+
-
39+
name: "Determine composer cache directory"
40+
id: "determine-composer-cache-directory"
41+
run: "echo \"::set-output name=directory::$(composer config cache-dir)\""
42+
43+
-
44+
name: "Cache dependencies installed with composer"
45+
uses: "actions/cache@v2"
46+
with:
47+
path: "${{ steps.determine-composer-cache-directory.outputs.directory }}"
48+
key: "php-${{ matrix.php-version }}-composer-${{ hashFiles('composer.lock') }}"
49+
restore-keys: "php-${{ matrix.php-version }}-composer-"
50+
51+
-
52+
name: "Install dependencies with composer"
53+
run: "composer install --no-interaction --no-progress --no-suggest --no-scripts"
54+
55+
-
56+
name: "Run friendsofphp/php-cs-fixer"
57+
run: "vendor/bin/php-cs-fixer fix --dry-run --diff"

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,3 @@ install:
3838
script:
3939
- composer validate --strict --no-check-lock
4040
- ./vendor/bin/simple-phpunit $PHPUNIT_FLAGS
41-
- ./vendor/bin/php-cs-fixer fix --dry-run --diff

0 commit comments

Comments
 (0)