Skip to content

Commit 764c141

Browse files
authored
Merge pull request #367 from doctrine/greg0ire-patch-1-1
Setup coding standard workflow
2 parents aa15026 + c8db6a0 commit 764c141

File tree

2 files changed

+40
-6
lines changed

2 files changed

+40
-6
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
2+
name: "Coding Standards"
3+
4+
on: ["pull_request", "push"]
5+
6+
jobs:
7+
coding-standards:
8+
name: "Coding Standards"
9+
runs-on: "ubuntu-20.04"
10+
11+
strategy:
12+
matrix:
13+
php-version:
14+
- "7.4"
15+
16+
steps:
17+
- name: "Checkout"
18+
uses: "actions/checkout@v2"
19+
20+
- name: "Install PHP"
21+
uses: "shivammathur/setup-php@v2"
22+
with:
23+
coverage: "none"
24+
php-version: "${{ matrix.php-version }}"
25+
tools: "cs2pr"
26+
27+
- name: "Cache dependencies installed with Composer"
28+
uses: "actions/cache@v2"
29+
with:
30+
path: "~/.composer/cache"
31+
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
32+
restore-keys: "php-${{ matrix.php-version }}-composer-locked-"
33+
34+
- name: "Install dependencies with Composer"
35+
run: "composer install --no-interaction --no-progress --no-suggest"
36+
37+
# https://github.com/doctrine/.github/issues/3
38+
- name: "Run PHP_CodeSniffer"
39+
run: "vendor/bin/phpcs -q --no-colors --report=checkstyle | cs2pr"

.travis.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ php:
66
- 7.1
77
- 7.2
88
- 7.3
9-
- 7.4snapshot
9+
- 7.4
1010

1111
cache:
1212
directories:
@@ -42,11 +42,6 @@ jobs:
4242
- wget https://scrutinizer-ci.com/ocular.phar
4343
- php ocular.phar code-coverage:upload --format=php-clover clover.xml
4444

45-
- stage: Code Quality
46-
env: CODING_STANDARDS
47-
install: travis_retry composer install --prefer-dist
48-
script: ./vendor/bin/phpcs
49-
5045
- stage: Code Quality
5146
env: STATIC_ANALYSIS
5247
install: travis_retry composer install --prefer-dist

0 commit comments

Comments
 (0)