-
-
Notifications
You must be signed in to change notification settings - Fork 17
99 lines (84 loc) · 2.88 KB
/
build.yaml
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: build
on:
pull_request:
push:
branches:
- master
- develop
jobs:
unit-tests:
name: Unit tests
runs-on: ubuntu-latest
container:
image: shivammathur/node:latest-${{ matrix.arch }}
strategy:
matrix:
include:
- php-version: 7.1
coverage: none
arch: "amd64"
- php-version: 7.2
coverage: none
arch: "amd64"
- php-version: 7.3
coverage: none
arch: "amd64"
- php-version: 7.4
coverage: none
arch: "amd64"
- php-version: 8.0
coverage: xdebug
arch: "amd64"
- php-version: 8.0
coverage: none
arch: "i386"
- php-version: 8.1
coverage: none
arch: "amd64"
- php-version: 8.2
coverage: none
arch: "amd64"
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: composer:v2
coverage: "${{ matrix.coverage }}"
- name: Cache dependencies installed with Composer
uses: actions/cache@v1
with:
path: ~/.cache/composer
key: php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: php${{ matrix.php-version }}-composer-
- name: Install Composer dependencies
run: composer install --no-progress
- name: Install "covers-ignore"
if: "${{ matrix.coverage != 'none' }}"
run: composer require --dev rawr/covers-ignore:0.10
- name: Remove @covers annotations
if: "${{ matrix.coverage != 'none' }}"
run: ./vendor/bin/covers-ignore test
- name: Run tests (no coverage)
if: "${{ matrix.coverage == 'none' }}"
run: ./vendor/bin/phpunit test --no-coverage
- name: Run tests (coverage)
if: "${{ matrix.coverage != 'none' }}"
run: ./vendor/bin/phpunit test --whitelist src
- name: Install "php-coveralls/php-coveralls"
if: "${{ matrix.coverage != 'none' }}"
run: composer require php-coveralls/php-coveralls --no-progress
- name: Upload coverage results to Coveralls
if: "${{ matrix.coverage != 'none' }}"
continue-on-error: true
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: git config --global --add safe.directory /__w/T-Regx/T-Regx && ./vendor/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v
- name: Upload coverage results to Code Climate
if: "${{ matrix.coverage != 'none' }}"
uses: paambaati/[email protected]
continue-on-error: true
env:
CC_TEST_REPORTER_ID: ${{ secrets.CODE_CLIMATE_REPORTER_ID }}