-
Notifications
You must be signed in to change notification settings - Fork 6
79 lines (63 loc) · 1.88 KB
/
standard-test-coverage.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: PSR-12 coding standard, Test, Coverage
on:
pull_request:
push:
branches:
- master
- dev
jobs:
coding-standard:
name: PSR-12 coding standard
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: shivammathur/setup-php@v2
with:
php-version: 8.2
- name: Install PHP code sniffer
run: composer global require squizlabs/php_codesniffer
- name: Check against PSR12 standard
run: |
`composer global config bin-dir --absolute --quiet`/phpcs --standard=PSR12 ./src
tests:
needs: coding-standard
name: PHP ${{ matrix.php }} - Guzzle ${{ matrix.guzzle }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [ 8.0, 8.1, 8.2 ]
guzzle: [ ^6, ^7 ]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: json,curl
- name: Install dependencies
run: composer require guzzlehttp/guzzle:${{ matrix.guzzle }} --no-interaction --prefer-dist
- name: Run test suite
run: ./vendor/bin/phpunit --testdox
coverage:
needs: tests
name: Coverage
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: shivammathur/setup-php@v2
with:
coverage: pcov
php-version: 8.2
extensions: json,curl
- name: Install dependencies
run: composer install --no-interaction --prefer-dist
- name: Run tests for coverage
run: ./vendor/bin/phpunit --coverage-clover=coverage.xml
- name: Push to Codecov
run: bash <(curl -s https://codecov.io/bash)
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}