forked from WalterWoshid/php-dissect
-
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (44 loc) · 1.48 KB
/
php-tests.yml
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
name: PHP Tests
on:
pull_request:
push:
permissions:
contents: read
jobs:
run:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ ubuntu-latest ]
php-version: ['8.2', '8.3']
name: PHP ${{ matrix.php-version }} test on ${{ matrix.operating-system }}
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Install PHP
id: php
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
- name: Check PHP version
run: php -v
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-${{ matrix.operating-system }}-php-${{ steps.php.outputs.php-version }}
restore-keys: |
${{ runner.os }}-${{ matrix.operating-system }}-php-${{ steps.php.outputs.php-version }}
- if: steps.composer-cache.outputs.cache-hit != 'true'
name: Install Composer dependencies
run: composer install --prefer-dist --no-progress
- name: PHPUnit Tests
run: vendor/bin/phpunit --coverage-clover ./tests/coverage.xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./tests/coverage.xml
flags: os-${{ matrix.operating-system }}_php-${{ matrix.php-version }}
verbose: true