-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (46 loc) · 1.36 KB
/
test-php.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: Test PHP
on:
push:
branches:
- main
pull_request:
branches:
- main
- 'feature/**'
jobs:
test-php:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['8.1', '8.2', '8.3']
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies
run: composer install
working-directory: scaffold
- name: Check coding standards
run: composer lint
working-directory: scaffold
continue-on-error: ${{ vars.CI_LINT_IGNORE_FAILURE == '1' }}
- name: Run tests
run: XDEBUG_MODE=coverage composer test
working-directory: scaffold
continue-on-error: ${{ vars.CI_TEST_IGNORE_FAILURE == '1' }}
- name: Upload coverage report as an artifact
uses: actions/upload-artifact@v4
with:
name: ${{github.job}}-code-coverage-report-${{ matrix.php-versions }}
path: ./.coverage-html
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v4
with:
files: ./cobertura.xml
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}