Skip to content

Commit 0f3d7c8

Browse files
committed
Move static analysis to an independent action
1 parent a0c7834 commit 0f3d7c8

File tree

3 files changed

+50
-6
lines changed

3 files changed

+50
-6
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,6 @@ jobs:
6363
if: matrix.php-version == '8.0'
6464
run: composer update --ignore-platform-reqs --prefer-dist --no-interaction --no-progress --optimize-autoloader
6565

66-
- name: PHPCS check
67-
run: vendor/bin/phpcs
68-
69-
- name: Psalm static analysis
70-
run: vendor/bin/psalm --no-progress
71-
7266
- name: PHPUnit run with coverage on PHP 7.4
7367
if: matrix.php-version == '7.4'
7468
run: vendor/bin/phpunit --coverage-clover=coverage.clover

.github/workflows/static.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
on:
2+
- pull_request
3+
- push
4+
5+
name: static
6+
7+
jobs:
8+
mutation:
9+
name: PHP ${{ matrix.php-version }}-${{ matrix.os }}
10+
11+
runs-on: ${{ matrix.os }}
12+
13+
strategy:
14+
matrix:
15+
os:
16+
- ubuntu-latest
17+
18+
php-version:
19+
- "7.4"
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v2
24+
25+
- name: Install PHP
26+
uses: shivammathur/setup-php@v2
27+
with:
28+
php-version: ${{ matrix.php-version }}
29+
ini-values: memory_limit=-1
30+
tools: composer:v2
31+
32+
- name: Determine composer cache directory
33+
run: echo "::set-env name=COMPOSER_CACHE_DIR::$(composer config cache-dir)"
34+
35+
- name: Cache dependencies installed with composer
36+
uses: actions/cache@v2
37+
with:
38+
path: ${{ env.COMPOSER_CACHE_DIR }}
39+
key: php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
40+
restore-keys: php-${{ matrix.php-version }}-composer-
41+
42+
- name: Install dependencies with composer
43+
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader
44+
45+
- name: PHPCS check
46+
run: vendor/bin/phpcs
47+
48+
- name: Psalm static analysis
49+
run: vendor/bin/psalm --no-progress

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
[![Latest Stable Version](https://poser.pugx.org/httpsoft/http-error-handler/v)](https://packagist.org/packages/httpsoft/http-error-handler)
55
[![Total Downloads](https://poser.pugx.org/httpsoft/http-error-handler/downloads)](https://packagist.org/packages/httpsoft/http-error-handler)
66
[![GitHub Build Status](https://github.com/httpsoft/http-error-handler/workflows/build/badge.svg)](https://github.com/httpsoft/http-error-handler/actions)
7+
[![GitHub Static Analysis Status](https://github.com/httpsoft/http-error-handler/workflows/static/badge.svg)](https://github.com/httpsoft/http-error-handler/actions)
78
[![Scrutinizer Code Coverage](https://scrutinizer-ci.com/g/httpsoft/http-error-handler/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/httpsoft/http-error-handler/?branch=master)
89
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/httpsoft/http-error-handler/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/httpsoft/http-error-handler/?branch=master)
910

0 commit comments

Comments
 (0)