Skip to content

Commit a5f5c51

Browse files
authored
Merge pull request #4344 from greg0ire/static-analysis-workflow
Static analysis workflow
2 parents d896d62 + 78850f4 commit a5f5c51

File tree

3 files changed

+81
-68
lines changed

3 files changed

+81
-68
lines changed

.github/workflows/coding-standards.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
name: "Coding Standards"
22

3-
on: ["pull_request", "push"]
3+
on:
4+
pull_request:
5+
branches:
6+
- "*.x"
7+
- "master"
8+
push:
9+
branches:
10+
- "*.x"
11+
- "master"
412

513
jobs:
614
coding-standards:

.github/workflows/continuous-integration.yml

Lines changed: 10 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,17 @@
11

22
name: "Continuous Integration"
33

4-
on: ["pull_request", "push"]
4+
on:
5+
pull_request:
6+
branches:
7+
- "*.x"
8+
- "master"
9+
push:
10+
branches:
11+
- "*.x"
12+
- "master"
513

614
jobs:
7-
static-analysis-phpstan:
8-
name: "Static Analysis with PHPStan"
9-
runs-on: "ubuntu-20.04"
10-
11-
strategy:
12-
matrix:
13-
php-version:
14-
- "7.4"
15-
16-
steps:
17-
- name: "Checkout code"
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-
- name: "Run a static analysis with phpstan/phpstan"
38-
run: "vendor/bin/phpstan analyse --error-format=checkstyle | cs2pr"
39-
40-
static-analysis-psalm:
41-
name: "Static Analysis with Psalm"
42-
runs-on: "ubuntu-20.04"
43-
44-
strategy:
45-
matrix:
46-
php-version:
47-
- "7.4"
48-
49-
steps:
50-
- name: "Checkout code"
51-
uses: "actions/checkout@v2"
52-
53-
- name: "Install PHP"
54-
uses: "shivammathur/setup-php@v2"
55-
with:
56-
coverage: "none"
57-
php-version: "${{ matrix.php-version }}"
58-
59-
- name: "Cache dependencies installed with composer"
60-
uses: "actions/cache@v2"
61-
with:
62-
path: "~/.composer/cache"
63-
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
64-
restore-keys: "php-${{ matrix.php-version }}-composer-locked-"
65-
66-
- name: "Install dependencies with composer"
67-
run: "composer install --no-interaction --no-progress --no-suggest"
68-
69-
- name: "Run a static analysis with vimeo/psalm"
70-
run: "vendor/bin/psalm --show-info=false --stats --output-format=github --threads=4"
71-
7215
phpunit-oci8:
7316
name: "PHPUnit on OCI8"
7417
runs-on: "ubuntu-20.04"
@@ -142,7 +85,7 @@ jobs:
14285
coverage: "pcov"
14386

14487
- name: "Cache dependencies installed with composer"
145-
uses: "actions/cache@v1"
88+
uses: "actions/cache@v2"
14689
with:
14790
path: "~/.composer/cache"
14891
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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"
47+
48+
static-analysis-psalm:
49+
name: "Static Analysis with Psalm"
50+
runs-on: "ubuntu-20.04"
51+
52+
strategy:
53+
matrix:
54+
php-version:
55+
- "7.4"
56+
57+
steps:
58+
- name: Checkout code
59+
uses: actions/checkout@v2
60+
61+
- name: Psalm
62+
uses: docker://vimeo/psalm-github-actions

0 commit comments

Comments
 (0)