Skip to content

Commit 8567b0e

Browse files
authored
Add new PHP versions to build workflow (#2)
1 parent f519468 commit 8567b0e

File tree

8 files changed

+78
-43
lines changed

8 files changed

+78
-43
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"devanych/view-renderer": "^1.0",
4242
"phpunit/phpunit": "^9.5",
4343
"squizlabs/php_codesniffer": "^3.7",
44-
"vimeo/psalm": "^5.2"
44+
"vimeo/psalm": "^4.9|^5.2"
4545
},
4646
"provide": {
4747
"psr/http-message-implementation": "1.0",
File renamed without changes.

phpunit.xml.dist

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit
3-
bootstrap="vendor/autoload.php"
4-
executionOrder="random"
5-
beStrictAboutCoversAnnotation="true"
6-
beStrictAboutOutputDuringTests="true"
7-
beStrictAboutTodoAnnotatedTests="true"
8-
convertWarningsToExceptions="true"
9-
convertNoticesToExceptions="true"
10-
convertErrorsToExceptions="true"
11-
resolveDependencies="true"
12-
stopOnFailure="false"
13-
failOnWarning="true"
14-
failOnRisky="true"
15-
verbose="true"
16-
colors="true"
3+
bootstrap="vendor/autoload.php"
4+
executionOrder="random"
5+
beStrictAboutCoversAnnotation="true"
6+
beStrictAboutOutputDuringTests="true"
7+
beStrictAboutTodoAnnotatedTests="true"
8+
convertWarningsToExceptions="true"
9+
convertNoticesToExceptions="true"
10+
convertErrorsToExceptions="true"
11+
resolveDependencies="true"
12+
stopOnFailure="false"
13+
failOnWarning="true"
14+
failOnRisky="true"
15+
verbose="true"
16+
colors="true"
1717
>
1818
<php>
1919
<ini name="error_reporting" value="-1"/>
2020
</php>
2121

2222
<testsuites>
2323
<testsuite name="HttpSoft Basis Test Suite">
24-
<directory>tests</directory>
24+
<directory>./tests</directory>
2525
</testsuite>
2626
</testsuites>
2727

2828
<coverage processUncoveredFiles="true">
2929
<include>
30-
<directory suffix=".php">src</directory>
30+
<directory suffix=".php">./src</directory>
3131
</include>
3232
</coverage>
3333
</phpunit>

psalm.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
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"
7-
findUnusedPsalmSuppress="true"
88
>
99
<projectFiles>
1010
<directory name="src"/>

0 commit comments

Comments
 (0)