Skip to content

Commit 88ba515

Browse files
authored
Various Updates and changes to the repo (#231)
1 parent 5b8c9ed commit 88ba515

133 files changed

Lines changed: 752 additions & 892 deletions

File tree

Some content is hidden

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

.github/workflows/codecov.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,21 @@ jobs:
2323
matrix:
2424
php-version: ['8.2']
2525
steps:
26-
- uses: actions/checkout@v3
26+
- uses: actions/checkout@v4
2727
- uses: shivammathur/setup-php@v2
2828
with:
2929
php-version: ${{ matrix.php-version }}
3030
coverage: xdebug
3131
extensions: apcu
3232
- name: Cache Composer Packages
3333
id: composer-cache
34-
uses: actions/cache@v3
34+
uses: actions/cache@v4
3535
with:
3636
path: vendor
37-
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
37+
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
3838
restore-keys: |
39-
${{ runner.os }}-php-
40-
- run: make install phpunit
39+
${{ runner.os }}-php-${{ matrix.php-version }}-
40+
- run: make composer.lock test
4141
env:
4242
XDEBUG_MODE: coverage
4343
PHPUNIT_OPTIONS: --coverage-clover coverage.xml --log-junit junit.xml

.github/workflows/labeler.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
pull-requests: write
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v3
12+
- uses: actions/checkout@v4
1313
- uses: actions/labeler@v4
1414
with:
1515
repo-token: "${{ secrets.GITHUB_TOKEN }}"

.github/workflows/publish-docs.yml

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

.github/workflows/static-analysis.yml

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,42 @@ jobs:
3232
matrix:
3333
php-version: ['8.2']
3434
steps:
35-
- uses: actions/checkout@v3
35+
- uses: actions/checkout@v4
3636
- uses: shivammathur/setup-php@v2
3737
with:
3838
php-version: '${{ matrix.php-version }}'
3939
coverage: none
40-
- run: make composer-install phpunit-install psalm-install
41-
- run: php src/SonsOfPHP/Bard/bin/bard install -n -vvv
42-
- run: make psalm-github
40+
- name: Cache Composer Packages
41+
id: composer-cache
42+
uses: actions/cache@v4
43+
with:
44+
path: vendor
45+
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
46+
restore-keys: |
47+
${{ runner.os }}-php-${{ matrix.php-version }}-
48+
- run: make composer.lock pkg-install tools/psalm/vendor/bin/psalm tools/phpunit/vendor/bin/phpunit
49+
- name: Get changed PHP files
50+
if: github.ref != 'refs/heads/main'
51+
id: changed-php-files
52+
uses: tj-actions/changed-files@v45
53+
with:
54+
files: |
55+
**.php
56+
- name: Psalm on modified PHP files only
57+
if: steps.changed-php-files.outputs.any_changed == 'true' && github.ref != 'refs/heads/main'
58+
run: php -dxdebug.mode=off ${PSALM} --ignore-baseline --long-progress --monochrome --output-format=github ${CHANGED_FILES}
59+
env:
60+
XDEBUG_MODE: off
61+
PSALM: tools/psalm/vendor/bin/psalm
62+
CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }}
63+
- name: Psalm on mainline for all files
64+
if: github.ref == 'refs/heads/main'
65+
run: php -dxdebug.mode=off $(PSALM) --ignore-baseline --long-progress --monochrome --output-format=github --report=results.sarif
66+
env:
67+
XDEBUG_MODE: off
68+
PSALM: tools/psalm/vendor/bin/psalm
4369
- name: Upload Security Analysis to Github
4470
if: github.ref == 'refs/heads/main'
45-
uses: github/codeql-action/upload-sarif@v2
71+
uses: github/codeql-action/upload-sarif@v3
4672
with:
4773
sarif_file: results.sarif

.github/workflows/unit-tests.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,18 @@ jobs:
3131
matrix:
3232
php-version: ['8.2', '8.3']
3333
steps:
34-
- uses: actions/checkout@v3
34+
- uses: actions/checkout@v4
3535
- uses: shivammathur/setup-php@v2
3636
with:
3737
php-version: ${{ matrix.php-version }}
3838
coverage: none
3939
extensions: apcu
4040
- name: Cache Composer Packages
4141
id: composer-cache
42-
uses: actions/cache@v3
42+
uses: actions/cache@v4
4343
with:
4444
path: vendor
45-
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
45+
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
4646
restore-keys: |
47-
${{ runner.os }}-php-
48-
- run: make install test
47+
${{ runner.os }}-php-${{ matrix.php-version }}-
48+
- run: make composer.lock test

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/build/cache/
2+
/build/logs/
13
/docs/coverage/
24
/docs/infection/
35
/site/

.php-cs-fixer.dist.php

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use PhpCsFixer\Config;
66
use PhpCsFixer\Finder;
7+
use PhpCsFixer\Runner\Parallel\ParallelConfigFactory;
78

89
$finder = Finder::create()
910
->in(__DIR__)
@@ -12,15 +13,21 @@
1213
->exclude('vendor')
1314
;
1415

15-
return (new Config())->setRules([
16-
// Rule sets
17-
'@PER-CS' => true,
18-
'@PHP80Migration:risky' => true,
19-
'@PHP81Migration' => true,
20-
'@PHPUnit100Migration:risky' => true,
16+
return (new Config())
17+
->setUsingCache(true)
18+
->setCacheFile(__DIR__ . '/build/cache/php-cs-fixer/php-cs-fixer.cache')
19+
->setParallelConfig(ParallelConfigFactory::detect())
20+
->setRules([
21+
// Rule sets
22+
'@PER-CS' => true,
23+
'@PHP80Migration:risky' => true,
24+
'@PHP81Migration' => true,
25+
'@PHPUnit100Migration:risky' => true,
2126

22-
// Rules
23-
'no_unused_imports' => true,
24-
'ordered_imports' => true,
25-
//'php_unit_test_class_requires_covers' => true,
26-
])->setFinder($finder);
27+
// Rules
28+
'no_unused_imports' => true,
29+
'ordered_imports' => true,
30+
//'php_unit_test_class_requires_covers' => true,
31+
])
32+
->setFinder($finder)
33+
;

0 commit comments

Comments
 (0)