Skip to content

Commit f4211cb

Browse files
authored
Add new PHP versions to build workflow (#3)
1 parent ef116b3 commit f4211cb

File tree

7 files changed

+77
-37
lines changed

7 files changed

+77
-37
lines changed

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
/.scrutinizer.yml export-ignore
88
/phpcs.xml export-ignore
99
/phpunit.xml.dist export-ignore
10-
/psalm.xml export-ignore
10+
/psalm.xml.dist export-ignore

.github/workflows/build.yml

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
on:
2-
- pull_request
3-
- push
2+
pull_request:
3+
paths-ignore:
4+
- 'docs/**'
5+
- 'README.md'
6+
- 'CHANGELOG.md'
7+
- '.gitignore'
8+
- '.gitattributes'
9+
- 'psalm.xml.dist'
10+
11+
push:
12+
paths-ignore:
13+
- 'docs/**'
14+
- 'README.md'
15+
- 'CHANGELOG.md'
16+
- '.gitignore'
17+
- '.gitattributes'
18+
- 'psalm.xml.dist'
419

520
name: build
621

@@ -22,40 +37,42 @@ jobs:
2237
php:
2338
- "7.4"
2439
- "8.0"
40+
- "8.1"
41+
- "8.2"
2542

2643
steps:
27-
- name: Checkout
28-
uses: actions/checkout@v2
44+
- name: Checkout.
45+
uses: actions/checkout@v3
2946

30-
- name: Install PHP
47+
- name: Install PHP with extensions.
3148
uses: shivammathur/setup-php@v2
3249
with:
3350
php-version: ${{ matrix.php }}
3451
ini-values: date.timezone='UTC'
3552
tools: composer:v2
3653
coverage: pcov
3754

38-
- name: Determine composer cache directory on Linux
55+
- name: Determine composer cache directory on Linux.
3956
if: matrix.os == 'ubuntu-latest'
4057
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
4158

42-
- name: Determine composer cache directory on Windows
59+
- name: Determine composer cache directory on Windows.
4360
if: matrix.os == 'windows-latest'
4461
run: echo "COMPOSER_CACHE_DIR=~\AppData\Local\Composer" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
4562

46-
- name: Cache dependencies installed with composer
47-
uses: actions/cache@v2
63+
- name: Cache dependencies installed with composer.
64+
uses: actions/cache@v3
4865
with:
4966
path: ${{ env.COMPOSER_CACHE_DIR }}
5067
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
5168
restore-keys: |
5269
php${{ matrix.php }}-composer-
5370
54-
- name: Update composer
71+
- name: Update composer.
5572
run: composer self-update
5673

57-
- name: Install dependencies with composer
74+
- name: Install dependencies with composer.
5875
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
5976

60-
- name: Run tests with phpunit
77+
- name: Run tests with phpunit.
6178
run: vendor/bin/phpunit --colors=always

.github/workflows/static.yml

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
on:
2-
- pull_request
3-
- push
2+
pull_request:
3+
paths-ignore:
4+
- 'docs/**'
5+
- 'README.md'
6+
- 'CHANGELOG.md'
7+
- '.gitignore'
8+
- '.gitattributes'
9+
- 'phpunit.xml.dist'
10+
11+
push:
12+
paths-ignore:
13+
- 'docs/**'
14+
- 'README.md'
15+
- 'CHANGELOG.md'
16+
- '.gitignore'
17+
- '.gitattributes'
18+
- 'phpunit.xml.dist'
419

520
name: static
621

@@ -18,37 +33,39 @@ jobs:
1833
php:
1934
- "7.4"
2035
- "8.0"
36+
- "8.1"
37+
- "8.2"
2138

2239
steps:
23-
- name: Checkout
24-
uses: actions/checkout@v2
40+
- name: Checkout.
41+
uses: actions/checkout@v3
2542

26-
- name: Install PHP
43+
- name: Install PHP with extensions.
2744
uses: shivammathur/setup-php@v2
2845
with:
2946
php-version: ${{ matrix.php }}
3047
ini-values: memory_limit=-1
3148
tools: composer:v2
3249

33-
- name: Determine composer cache directory
50+
- name: Determine composer cache directory.
3451
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
3552

36-
- name: Cache dependencies installed with composer
37-
uses: actions/cache@v2
53+
- name: Cache dependencies installed with composer.
54+
uses: actions/cache@v3
3855
with:
3956
path: ${{ env.COMPOSER_CACHE_DIR }}
4057
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
4158
restore-keys: |
4259
php${{ matrix.php }}-composer-
4360
44-
- name: Update composer
61+
- name: Update composer.
4562
run: composer self-update
4663

47-
- name: Install dependencies with composer
64+
- name: Install dependencies with composer.
4865
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
4966

50-
- name: PHPCS check
67+
- name: PHPCS check.
5168
run: vendor/bin/phpcs
5269

53-
- name: Psalm static analysis
70+
- name: Psalm static analysis.
5471
run: vendor/bin/psalm --no-progress

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.phpunit.result.cache
22
composer.lock
33
phpunit.xml
4+
psalm.xml
45
vendor

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
},
2525
"require-dev": {
2626
"phpunit/phpunit": "^9.5",
27-
"squizlabs/php_codesniffer": "^3.6",
28-
"vimeo/psalm": "^4.8"
27+
"squizlabs/php_codesniffer": "^3.7",
28+
"vimeo/psalm": "^4.9|^5.2"
2929
},
3030
"provide": {
3131
"psr/http-message-implementation": "1.0"

phpunit.xml.dist

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<phpunit
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/8.5/phpunit.xsd"
5-
bootstrap="./vendor/autoload.php"
6-
executionOrder="depends,defects"
3+
bootstrap="vendor/autoload.php"
4+
executionOrder="random"
75
beStrictAboutCoversAnnotation="true"
86
beStrictAboutOutputDuringTests="true"
97
beStrictAboutTodoAnnotatedTests="true"
108
convertWarningsToExceptions="true"
119
convertNoticesToExceptions="true"
1210
convertErrorsToExceptions="true"
11+
resolveDependencies="true"
1312
stopOnFailure="false"
13+
failOnWarning="true"
14+
failOnRisky="true"
1415
verbose="true"
1516
colors="true"
1617
>
@@ -20,13 +21,13 @@
2021

2122
<testsuites>
2223
<testsuite name="HttpSoft Server Request Test Suite">
23-
<directory>./tests/</directory>
24+
<directory>./tests</directory>
2425
</testsuite>
2526
</testsuites>
2627

27-
<filter>
28-
<whitelist>
29-
<directory suffix=".php">./src/</directory>
30-
</whitelist>
31-
</filter>
28+
<coverage processUncoveredFiles="true">
29+
<include>
30+
<directory suffix=".php">./src</directory>
31+
</include>
32+
</coverage>
3233
</phpunit>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
<?xml version="1.0"?>
22
<psalm
33
errorLevel="1"
4+
findUnusedPsalmSuppress="true"
45
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
56
xmlns="https://getpsalm.org/schema/config"
67
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
78
>
89
<projectFiles>
910
<directory name="src" />
11+
<ignoreFiles>
12+
<directory name="vendor"/>
13+
</ignoreFiles>
1014
</projectFiles>
1115
</psalm>

0 commit comments

Comments
 (0)