Skip to content

Commit 81f558d

Browse files
committed
Split github actions, Add a phpstan lvl 6, validate cs-fixer, validate phpstan lvl3, add rector action, upgrade php 8.2 with rector, validate cs-fixer, update infection
1 parent b12b7a1 commit 81f558d

30 files changed

+1622
-779
lines changed

.github/workflows/actions.yml

Lines changed: 0 additions & 99 deletions
This file was deleted.

.github/workflows/infection.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Mutations
2+
on: push
3+
jobs:
4+
infection:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v3
8+
- uses: shivammathur/setup-php@v2
9+
with:
10+
php-version: '8.2'
11+
tools: composer:v2
12+
coverage: pcov
13+
- uses: actions/cache@v3
14+
with:
15+
path: '**/vendor'
16+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
17+
restore-keys: |
18+
${{ runner.os }}-composer-
19+
- uses: php-actions/composer@v6
20+
with:
21+
args: --prefer-dist
22+
php_version: '8.2'
23+
php_extensions: zip
24+
25+
- name: Infection
26+
run: |
27+
wget -q https://github.com/infection/infection/releases/download/0.26.18/infection.phar
28+
wget -q https://github.com/infection/infection/releases/download/0.26.18/infection.phar.asc
29+
chmod +x infection.phar
30+
./infection.phar
31+
32+
- name: Store infection log
33+
uses: actions/upload-artifact@v3
34+
with:
35+
path: infection.log

.github/workflows/phpstan-5.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: PHPStan level 5
2+
on: push
3+
jobs:
4+
phpstan:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v3
8+
- uses: actions/cache@v3
9+
with:
10+
path: '**/vendor'
11+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
12+
restore-keys: |
13+
${{ runner.os }}-composer-
14+
- uses: php-actions/composer@v6
15+
with:
16+
args: --prefer-dist
17+
php_version: '8.2'
18+
php_extensions: zip
19+
20+
- name: PHPStan
21+
uses: php-actions/phpstan@v3
22+
with:
23+
path: src/
24+
level: 5

.github/workflows/phpstan-6.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: PHPStan level 6
2+
on: push
3+
jobs:
4+
phpstan:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v3
8+
- uses: actions/cache@v3
9+
with:
10+
path: '**/vendor'
11+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
12+
restore-keys: |
13+
${{ runner.os }}-composer-
14+
- uses: php-actions/composer@v6
15+
with:
16+
args: --prefer-dist
17+
php_version: '8.2'
18+
php_extensions: zip
19+
20+
- name: PHPStan
21+
uses: php-actions/phpstan@v3
22+
with:
23+
path: src/
24+
level: 6

.github/workflows/phpstan-7.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: PHPStan level 7
2+
on: push
3+
jobs:
4+
phpstan:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v3
8+
- uses: actions/cache@v3
9+
with:
10+
path: '**/vendor'
11+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
12+
restore-keys: |
13+
${{ runner.os }}-composer-
14+
- uses: php-actions/composer@v6
15+
with:
16+
args: --prefer-dist
17+
php_version: '8.2'
18+
php_extensions: zip
19+
20+
- name: PHPStan
21+
uses: php-actions/phpstan@v3
22+
with:
23+
path: src/
24+
level: 7

.github/workflows/phpstan-8.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: PHPStan level 8
2+
on: push
3+
jobs:
4+
phpstan:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v3
8+
- uses: actions/cache@v3
9+
with:
10+
path: '**/vendor'
11+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
12+
restore-keys: |
13+
${{ runner.os }}-composer-
14+
- uses: php-actions/composer@v6
15+
with:
16+
args: --prefer-dist
17+
php_version: '8.2'
18+
php_extensions: zip
19+
20+
- name: PHPStan
21+
uses: php-actions/phpstan@v3
22+
with:
23+
path: src/
24+
level: 8

.github/workflows/quality.yaml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Quality (PHPStan lvl 4)
2+
on: push
3+
jobs:
4+
cs-fixer:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v3
8+
- uses: shivammathur/setup-php@v2
9+
with:
10+
php-version: '8.2'
11+
tools: composer:v2
12+
coverage: none
13+
- name: Cs-Fixer
14+
run: |
15+
wget -q https://cs.symfony.com/download/php-cs-fixer-v3.phar -O php-cs-fixer
16+
chmod a+x php-cs-fixer
17+
PHP_CS_FIXER_IGNORE_ENV=true ./php-cs-fixer fix src --dry-run -vvv
18+
19+
phpunit:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v3
23+
- uses: shivammathur/setup-php@v2
24+
with:
25+
php-version: '8.2'
26+
tools: composer:v2
27+
coverage: pcov
28+
- uses: actions/cache@v3
29+
with:
30+
path: '**/vendor'
31+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
32+
restore-keys: |
33+
${{ runner.os }}-composer-
34+
- uses: php-actions/composer@v6
35+
with:
36+
args: --prefer-dist
37+
php_version: '8.2'
38+
39+
- name: Run tests & generate Coverage
40+
run: bin/phpunit --configuration=phpunit.xml tests --coverage-html var/coverage
41+
42+
- name: Store coverage files
43+
uses: actions/upload-artifact@v3
44+
with:
45+
path: var/coverage
46+
47+
phpstan:
48+
runs-on: ubuntu-latest
49+
steps:
50+
- uses: actions/checkout@v3
51+
- uses: actions/cache@v3
52+
with:
53+
path: '**/vendor'
54+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
55+
restore-keys: |
56+
${{ runner.os }}-composer-
57+
- uses: php-actions/composer@v6
58+
with:
59+
args: --prefer-dist
60+
php_version: '8.2'
61+
php_extensions: zip
62+
63+
- name: PHPStan
64+
uses: php-actions/phpstan@v3
65+
with:
66+
path: src/
67+
level: 4

.github/workflows/rector.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# github action that checks code with Rector
2+
name: Rector
3+
4+
on:
5+
pull_request: null
6+
7+
jobs:
8+
rector:
9+
runs-on: ubuntu-latest
10+
if: github.event.pull_request.head.repo.full_name == 'php-etl/spreadsheet-plugin'
11+
steps:
12+
-
13+
if: github.event.pull_request.head.repo.full_name == github.repository
14+
uses: actions/checkout@v3
15+
with:
16+
# Must be used to trigger workflow after push
17+
token: ${{ secrets.ACCESS_TOKEN }}
18+
19+
-
20+
uses: shivammathur/setup-php@v2
21+
with:
22+
php-version: '8.2'
23+
extensions: zip
24+
coverage: none
25+
26+
- uses: "ramsey/composer-install@v2"
27+
28+
- run: bin/rector --ansi
29+
30+
-
31+
# commit only to core contributors who have repository access
32+
uses: stefanzweifel/git-auto-commit-action@v4
33+
with:
34+
commit_message: '[rector] Rector fixes'
35+
commit_author: 'GitHub Action <actions@github.com>'
36+
commit_user_email: 'action@github.com'

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
/vendor/
22
/.idea/
3+
bin/
4+
.php-cs-fixer.cache

.php-cs-fixer.dist.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
return (new PhpCsFixer\Config())
88
->setRiskyAllowed(true)
99
->setRules([
10+
'@PHP82Migration' => true,
1011
'@PHP81Migration' => true,
1112
'@PHP80Migration:risky' => true,
1213
'@PHPUnit84Migration:risky' => true,

0 commit comments

Comments
 (0)