-
Notifications
You must be signed in to change notification settings - Fork 173
60 lines (48 loc) · 1.44 KB
/
test.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
57
58
59
name: PHP Tests
on:
push:
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-20.04
env:
XDEBUG_MODE: coverage
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
strategy:
matrix:
php: [ 7.3, 7.4, 8.0, 8.2 ]
steps:
- uses: actions/checkout@v3
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ matrix.php }}-${{ hashFiles('**/composer.json') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php }}-
- name: Install dependencies
uses: php-actions/composer@v6
with:
php_version: ${{ matrix.php }}
version: 2.x
- name: Run tests
uses: php-actions/composer@v6
with:
php_version: ${{ matrix.php }}
php_extensions: xdebug
version: 2.x
command: run-script test
- name: Create build directory necessary for coveralls # see https://github.com/php-coveralls/php-coveralls/issues/251
run: mkdir -p build/logs
shell: bash
- name: workaround for failing build
run: git config --global --add safe.directory /app
shell: bash
- name: Upload coverage
uses: php-actions/composer@v6
with:
php_version: ${{ matrix.php }}
version: 2.x
command: run-script upload-coverage