-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (48 loc) · 2.04 KB
/
analysis.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
name: Code Analysis
on:
pull_request: ~
push:
branches:
- main
jobs:
code-validation:
name: ${{ matrix.actions.name }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
actions:
- name: Composer validate
run: composer validate --ansi --strict
- name: PHPStan
run: composer phpstan
- name: Ecs
run: composer check-cs
- name: PHPUnit
run: composer test
steps:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v2
with:
php-version: 8.2
coverage: pcov
tools: composer:v2
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies
uses: "ramsey/composer-install@v2"
- run: ${{ matrix.actions.run }}
- name: Coverage diff
uses: OpenClassrooms/[email protected]
if: ${{ hashFiles('build/coverage/coverage.xml') != '' && github.event_name == 'pull_request' }}
with:
action: check
files: '[{"coverage": "build/coverage/coverage.xml", "summary": "coverage-summary.json", "label": "Coverage", "badge": "coverage.svg"}]'
token: ${{ secrets.GITHUB_TOKEN }}
- name: Coverage update
uses: OpenClassrooms/[email protected]
if: ${{ hashFiles('build/coverage/coverage.xml') != '' && github.event_name == 'push' && github.ref_name == 'main' }}
with:
action: update
files: '[{"coverage": "build/coverage/coverage.xml", "summary": "coverage-summary.json", "label": "Coverage", "badge": "coverage.svg"}]'
token: ${{ secrets.GITHUB_TOKEN }}