-
Notifications
You must be signed in to change notification settings - Fork 2
68 lines (58 loc) · 2.32 KB
/
Copy pathphp.yml
File metadata and controls
68 lines (58 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Test
on:
push:
branches: ["master"]
merge_group:
pull_request:
branches: ["master"]
jobs:
test:
name: Test PHP ${{ matrix.php.version }} ${{ matrix.php.composer_flags }}
runs-on: ubuntu-latest
strategy:
matrix:
php:
- version: '8.2'
composer_flags: --prefer-lowest
- version: '8.3'
composer_flags: --prefer-lowest
- version: '8.4'
composer_flags: --prefer-lowest
- version: '8.2'
composer_flags: --prefer-stable
- version: '8.3'
composer_flags: --prefer-stable
- version: '8.4'
composer_flags: --prefer-stable
steps:
- uses: actions/checkout@v3
with:
# Fetch 10 commits or Scrutinizer will throw ("Failed to retrieve commit parents.
# If you use a shallow git checkout, please checkout at least a depth of one."),
# see: RepositoryIntrospector at scrutinizer-ci/ocular GitHub repository
fetch-depth: 10
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php.version }}
extensions: curl, mbstring, intl, libxml, simplexml
coverage: xdebug
- name: Get composer cache directory
id: composer-cache-dir
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache Composer packages
id: composer-cache-restore
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache-dir.outputs.dir }}
key: ${{ runner.os }}-composer-${{ matrix.php.composer_flags }}-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-${{ matrix.php.composer_flags }}-
- name: Install dependencies
run: (test -d vendor && echo vendor directory exists) || composer update ${{ matrix.php.composer_flags }} --no-progress --no-suggest
- name: Run PHPUnit
run: ./bin/phpunit --coverage-text --coverage-clover clover.xml
- name: Upload Scrutinizer coverage
if: matrix.php.version == '8.2' && matrix.php.composer_flags == '--prefer-stable'
uses: sudo-bot/action-scrutinizer@latest
with:
cli-args: "--format=php-clover clover.xml --revision=${{ github.event.pull_request.head.sha || github.sha }}"