-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (68 loc) · 2.6 KB
/
php-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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Test Suite
on:
# Controls when the action will be triggered.
push: # A push to any branch.
pull_request: # A pull request to the trunk (main/master branch).
branches: [ trunk ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
php-tests:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- php: '8.0'
composer-flags: '--prefer-lowest'
- php: '8.0'
- php: '8.1'
- php: '8.2'
- php: '8.3'
# Steps represent a sequence of tasks that will be executed as part of the job
name: "PHP${{ matrix.php }} ${{ matrix.composer-flags }}"
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
# extensions: json
# ini-values: "post_max_size=256M" #optional
coverage: pcov
- name: Validate composer.json and composer.lock
run: composer validate --strict
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-php-
- name: Update composer dependencies
run: composer update -o --no-interaction --no-progress --prefer-dist ${{ matrix.composer-flags }}
- name: Run TEST suite
run: composer run-script test:ci -- -C --coverage tests/output/coverage.xml --coverage-src=src
#run: vendor/bin/tester tests -C --coverage tests/output/coverage.xml --coverage-src=src
- name: Install php-coveralls
run: composer global require -o --no-interaction --no-progress --prefer-dist php-coveralls/php-coveralls
- name: Upload coverage results to Coveralls
uses: nick-invision/retry@v2
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
COVERALLS_FLAG_NAME: "PHP${{ matrix.php }}"
with:
timeout_seconds: 60
max_attempts: 3
command: php-coveralls -x tests/output/coverage.xml -o tests/output/upload.json -v
coveralls-finish:
needs: php-tests
runs-on: ubuntu-latest
steps:
- name: Notify Coveralls when build is finished
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true