Skip to content

Commit 3a57f09

Browse files
committed
update github actions tu add PHP8.2 support
1 parent 3645837 commit 3a57f09

File tree

1 file changed

+47
-13
lines changed

1 file changed

+47
-13
lines changed

.github/workflows/build.yaml

Lines changed: 47 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,60 @@
11
---
2-
name: Build
2+
name: build
33
on:
44
push: ~
55
pull_request: ~
66

77
jobs:
8-
phpunit:
9-
name: PHPUnit tests on ${{ matrix.php }} ${{ matrix.composer-flags }}
10-
runs-on: ubuntu-latest
8+
linux_tests:
9+
name: PHP on ${{ matrix.php }} - ${{ matrix.stability }} - ${{ matrix.composer-flags }}
10+
runs-on: ubuntu-20.04
1111
strategy:
1212
matrix:
1313
php: ['8.1']
14-
composer-flags: [ '' ]
15-
phpunit-flags: [ '--coverage-text' ]
14+
stability: [prefer-lowest, prefer-stable]
15+
include:
16+
- php: '8.2'
17+
flags: "--ignore-platform-req=php"
18+
phpunit-flags: '--no-coverage'
19+
stability: prefer-stable
1620
steps:
17-
- uses: actions/checkout@v2
18-
- uses: shivammathur/setup-php@v2
21+
- name: Checkout code
22+
uses: actions/checkout@v2
23+
24+
- name: Setup PHP
25+
uses: shivammathur/setup-php@v2
1926
with:
2027
php-version: ${{ matrix.php }}
21-
coverage: pcov
28+
coverage: xdebug
2229
tools: composer:v2
23-
- run: composer update --no-progress ${{ matrix.composer-flags }}
24-
- run: composer phpunit
25-
- run: composer phpstan
26-
- run: composer phpcs
30+
- name: Check PHP Version
31+
run: php -v
32+
33+
- name: Validate composer files
34+
run: composer validate --strict
35+
36+
- name: Get Composer Cache Directory
37+
id: composer-cache
38+
run: |
39+
echo "::set-output name=dir::$(composer config cache-files-dir)"
40+
- uses: actions/cache@v2
41+
with:
42+
path: ${{ steps.composer-cache.outputs.dir }}
43+
key: ${{ runner.os }}-composer-${{ matrix.stability }}-${{ matrix.flags }}-${{ hashFiles('**/composer.lock') }}
44+
restore-keys: |
45+
${{ runner.os }}-composer-${{ matrix.stability }}-${{ matrix.flags }}-
46+
${{ runner.os }}-composer-
47+
48+
- name: Install dependencies
49+
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress ${{ matrix.flags }}
50+
51+
- name: Run Unit tests with coverage
52+
run: composer phpunit -- ${{ matrix.phpunit-flags }}
53+
54+
- name: Run static analysis
55+
run: composer phpstan
56+
if: ${{ matrix.php == '8.1' && matrix.stability == 'prefer-stable'}}
57+
58+
- name: Run Coding style rules
59+
run: composer phpcs:fix
60+
if: ${{ matrix.php == '8.1' && matrix.stability == 'prefer-stable'}}

0 commit comments

Comments
 (0)