Skip to content

Commit dbac4b4

Browse files
authored
Merge pull request #12 from php-etl/feature/qualityflow-improvments
WIP: Split github actions, Add a phpstan lvl 6, validate cs-fixer, validat…
2 parents b12b7a1 + cd9ddef commit dbac4b4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+3318
-2119
lines changed

.github/workflows/actions.yml

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

.github/workflows/infection.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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+
- name: Infection
25+
run: |
26+
wget -q https://github.com/infection/infection/releases/download/0.26.18/infection.phar
27+
wget -q https://github.com/infection/infection/releases/download/0.26.18/infection.phar.asc
28+
chmod +x infection.phar
29+
./infection.phar
30+
31+
- name: Store infection log
32+
uses: actions/upload-artifact@v3
33+
with:
34+
path: infection.log

.github/workflows/phpstan-5.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: PHPStan level 5
2+
on: push
3+
jobs:
4+
phpstan5:
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+
- name: PHPStan
20+
uses: php-actions/phpstan@v3
21+
with:
22+
path: src/
23+
level: 5

.github/workflows/phpstan-6.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: PHPStan level 6
2+
on: push
3+
jobs:
4+
phpstan6:
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+
- name: PHPStan
20+
uses: php-actions/phpstan@v3
21+
with:
22+
path: src/
23+
level: 6

.github/workflows/phpstan-7.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: PHPStan level 7
2+
on: push
3+
jobs:
4+
phpstan7:
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+
- name: PHPStan
20+
uses: php-actions/phpstan@v3
21+
with:
22+
path: src/
23+
level: 7

.github/workflows/phpstan-8.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: PHPStan level 8
2+
on: push
3+
jobs:
4+
phpstan8:
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+
- name: PHPStan
20+
uses: php-actions/phpstan@v3
21+
with:
22+
path: src/
23+
level: 8

.github/workflows/phpunit.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: PHPUnit
2+
on: push
3+
jobs:
4+
phpunit:
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+
extensions: zip, xdebug
14+
- uses: actions/cache@v3
15+
with:
16+
path: '**/vendor'
17+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
18+
restore-keys: |
19+
${{ runner.os }}-composer-
20+
- uses: php-actions/composer@v6
21+
with:
22+
args: --prefer-dist
23+
php_version: '8.2'
24+
php_extensions: zip xdebug
25+
- name: Run tests & generate Coverage
26+
run: bin/phpunit --coverage-html var/coverage
27+
- name: Store coverage files
28+
uses: actions/upload-artifact@v3
29+
with:
30+
path: var/coverage

.github/workflows/quality.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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+
phpstan:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v3
22+
- uses: actions/cache@v3
23+
with:
24+
path: '**/vendor'
25+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
26+
restore-keys: |
27+
${{ runner.os }}-composer-
28+
- uses: php-actions/composer@v6
29+
with:
30+
args: --prefer-dist
31+
php_version: '8.2'
32+
php_extensions: zip xdebug
33+
- name: PHPStan
34+
uses: php-actions/phpstan@v3
35+
with:
36+
path: src/
37+
level: 4
38+
php_version: '8.2'
39+
php_extensions: zip xdebug

.github/workflows/rector.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+
16+
-
17+
uses: shivammathur/setup-php@v2
18+
with:
19+
php-version: '8.2'
20+
extensions: zip
21+
coverage: none
22+
23+
- uses: "ramsey/composer-install@v2"
24+
25+
- run: bin/rector --ansi
26+
27+
-
28+
# commit only to core contributors who have repository access
29+
uses: stefanzweifel/git-auto-commit-action@v4
30+
with:
31+
commit_message: '[rector] Rector fixes'
32+
commit_author: 'GitHub Action <actions@github.com>'
33+
commit_user_email: 'action@github.com'

.gitignore

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

0 commit comments

Comments
 (0)