-
Notifications
You must be signed in to change notification settings - Fork 3
77 lines (63 loc) · 2.06 KB
/
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
name: Test
on:
push:
branches: [ "master" ]
pull_request:
types: [ "opened", "synchronize" ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
php: [ '8.1', '8.2' ]
steps:
- uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2, cs2pr
coverage: pcov
- name: Get Cache
id: composer-cache
uses: actions/cache@v3
with:
path: |
application/vendor
./.php-cs-fixer.cache
key: composer-${{ hashFiles('**/composer.lock') }}
restore-keys: composer-
- name: Install dependencies
working-directory: ./application
run: composer install
- name: PHPStan
working-directory: ./application
run: vendor/bin/phpstan
- name: PHPUnit
run: application/vendor/bin/phpunit --printer mheap\\GithubActionsReporter\\Printer
- name: Code style
if: matrix.php == '8.1'
run: |
application/vendor/bin/php-cs-fixer fix --dry-run --diff --ansi || true
application/vendor/bin/php-cs-fixer fix --dry-run --format=checkstyle | cs2pr
- name: Upload coverage to Coveralls
if: matrix.php == '8.1'
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: application/vendor/bin/php-coveralls
- name: Upload coverage to Codecov
if: matrix.php == '8.1'
uses: codecov/codecov-action@v3
- name: Upload coverage to Codacy
if: matrix.php == '8.1'
uses: codacy/[email protected]
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: build/logs/clover.xml
- name: Upload coverage to Codeclimate
if: matrix.php == '8.1'
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: dded30dc4b62f393c80ed752f13c7c7efaf748c3573daee0f4040615457ff9c0