Skip to content

Commit 9033b95

Browse files
committed
Extract SA jobs to a separate workflow
The end goal is to have a generic workflow that can be contributed back to our .github repository.
1 parent 30218ee commit 9033b95

File tree

2 files changed

+78
-65
lines changed

2 files changed

+78
-65
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -12,71 +12,6 @@ on:
1212
- "master"
1313

1414
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: "Install PHP"
62-
uses: "shivammathur/setup-php@v2"
63-
with:
64-
coverage: "none"
65-
php-version: "${{ matrix.php-version }}"
66-
67-
- name: "Cache dependencies installed with composer"
68-
uses: "actions/cache@v2"
69-
with:
70-
path: "~/.composer/cache"
71-
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
72-
restore-keys: "php-${{ matrix.php-version }}-composer-locked-"
73-
74-
- name: "Install dependencies with composer"
75-
run: "composer install --no-interaction --no-progress --no-suggest"
76-
77-
- name: "Run a static analysis with vimeo/psalm"
78-
run: "vendor/bin/psalm --show-info=false --stats --output-format=github --threads=4"
79-
8015
phpunit-oci8:
8116
name: "PHPUnit on OCI8"
8217
runs-on: "ubuntu-20.04"
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
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: "Install PHP"
62+
uses: "shivammathur/setup-php@v2"
63+
with:
64+
coverage: "none"
65+
php-version: "${{ matrix.php-version }}"
66+
67+
- name: "Cache dependencies installed with composer"
68+
uses: "actions/cache@v2"
69+
with:
70+
path: "~/.composer/cache"
71+
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
72+
restore-keys: "php-${{ matrix.php-version }}-composer-locked-"
73+
74+
- name: "Install dependencies with composer"
75+
run: "composer install --no-interaction --no-progress --no-suggest"
76+
77+
- name: "Run a static analysis with vimeo/psalm"
78+
run: "vendor/bin/psalm --show-info=false --stats --output-format=github --threads=4"

0 commit comments

Comments
 (0)