Skip to content

Commit f3afa67

Browse files
committed
Reuse shared workflows
1 parent 3955681 commit f3afa67

File tree

2 files changed

+46
-5
lines changed

2 files changed

+46
-5
lines changed

.github/workflows/static-analysis.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
2+
name: "Static Analysis"
3+
4+
on:
5+
pull_request:
6+
branches:
7+
- "*.x"
8+
- "master"
9+
push:
10+
branches:
11+
- "*.x"
12+
- "master"
13+
14+
jobs:
15+
static-analysis-phpstan:
16+
name: "Static Analysis with PHPStan"
17+
runs-on: "ubuntu-20.04"
18+
19+
strategy:
20+
matrix:
21+
php-version:
22+
- "7.4"
23+
24+
steps:
25+
- name: "Checkout code"
26+
uses: "actions/checkout@v2"
27+
28+
- name: "Install PHP"
29+
uses: "shivammathur/setup-php@v2"
30+
with:
31+
coverage: "none"
32+
php-version: "${{ matrix.php-version }}"
33+
tools: "cs2pr"
34+
35+
- name: "Cache dependencies installed with composer"
36+
uses: "actions/cache@v2"
37+
with:
38+
path: "~/.composer/cache"
39+
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
40+
restore-keys: "php-${{ matrix.php-version }}-composer-locked-"
41+
42+
- name: "Install dependencies with composer"
43+
run: "composer install --no-interaction --no-progress --no-suggest"
44+
45+
- name: "Run a static analysis with phpstan/phpstan"
46+
run: "vendor/bin/phpstan analyse --error-format=checkstyle | cs2pr"

.travis.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,3 @@ jobs:
3939
after_script:
4040
- wget https://scrutinizer-ci.com/ocular.phar
4141
- php ocular.phar code-coverage:upload --format=php-clover clover.xml
42-
43-
- stage: Code Quality
44-
env: STATIC_ANALYSIS
45-
install: travis_retry composer update --prefer-dist
46-
script: vendor/bin/phpstan analyse

0 commit comments

Comments
 (0)