-
Notifications
You must be signed in to change notification settings - Fork 13
56 lines (41 loc) · 1.67 KB
/
Copy pathphp.yml
File metadata and controls
56 lines (41 loc) · 1.67 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
name: PHP Unit Tests
on: [push]
jobs:
build:
runs-on: ${{ matrix.operating-system }}
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: ['7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache vendor
id: vendor
uses: actions/cache@v4
with:
path: vendor
key: vendor
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl
ini-values: post_max_size=256M, short_open_tag=On
coverage: xdebug
tools: php-cs-fixer, phpunit
- name: Validate composer.json and composer.lock
run: composer validate
- name: Install code climate test reporter
run: curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter && chmod +x ./cc-test-reporter
- name: send to code climate that build is runnning
run: ./cc-test-reporter before-build
- name: Install dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist
- name: Make autoload.php
run: composer dump-autoload
- name: Execute tests
run: php -dxdebug.coverage_enable=1 vendor/bin/phpunit --configuration phpunit.xml --coverage-clover clover.xml; PHPUNIT_EXIT_CODE=$?; ./cc-test-reporter after-build -t clover --exit-code $PHPUNIT_EXIT_CODE; exit $PHPUNIT_EXIT_CODE