-
Notifications
You must be signed in to change notification settings - Fork 55
65 lines (56 loc) · 1.88 KB
/
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
57
58
59
60
61
62
63
64
65
name: Unit Tests
on:
push:
workflow_dispatch:
schedule:
- cron: "0 0 1 * *"
jobs:
test:
runs-on: ubuntu-20.04
strategy:
matrix:
php: [ '8.0', '7.4', '7.3' ]
continue-on-error: true
steps:
- uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: bcmath, simplexml, libxml, curl, json
coverage: pcov
- name: PHP ${{ matrix.php }} - Validate composer.json and composer.lock
run: composer validate
- name: PHP ${{ matrix.php }} - Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: PHP ${{ matrix.php }} - Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install
- name: PHP ${{ matrix.php }} - Run coverage test suite
env:
apiKey: ${{ secrets.STEAM_API_KEY }}
run: composer run-script test
- name: Publish Test Coverage
uses: paambaati/[email protected]
if: ${{ matrix.php }} == '8.0' && ${{ github.ref }} == 'master'
env:
apiKey: ${{ secrets.STEAM_API_KEY }}
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
XDEBUG_MODE: coverage
with:
coverageCommand: composer run-script coverage
coverageLocations: ${{github.workspace}}/coverage.clover:clover
debug: true
- uses: sarisia/actions-status-discord@v1
if: ${{ failure() }}
with:
status: ${{ job.status }}
webhook: ${{ secrets.DISCORD_WEBHOOK }}
title: "${{ matrix.php }}: Tests failed."
color: 'red'