-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (80 loc) · 3.48 KB
/
quality-assurance.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
80
81
82
83
84
85
86
87
name: Quality Assurance
on:
push:
paths:
- '**workflows/quality-assurance.yml'
- '**.php'
- '**phpcs.xml.dist'
- '**phpunit.xml.dist'
- '**psalm.xml'
- '**composer.json'
pull_request:
paths:
- '**workflows/quality-assurance.yml'
- '**.php'
- '**phpcs.xml.dist'
- '**phpunit.xml.dist'
- '**psalm.xml'
- '**composer.json'
workflow_dispatch:
inputs:
jobs:
required: true
type: choice
default: 'Run all'
description: 'Choose jobs to run'
options:
- 'Run all'
- 'Run PHPCS only'
- 'Run Psalm only'
- 'Run lint only'
- 'Run static analysis'
- 'Run unit tests only'
- 'Run mutation tests only'
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
jobs:
lint:
if: ${{ (github.event_name != 'workflow_dispatch') || ((github.event.inputs.jobs == 'Run all') || (github.event.inputs.jobs == 'Run lint only') || (github.event.inputs.jobs == 'Run static analysis')) }}
uses: inpsyde/reusable-workflows/.github/workflows/lint-php.yml@main
strategy:
matrix:
php: [ '8.1', '8.2', '8.3' ]
with:
PHP_VERSION: ${{ matrix.php }}
LINT_ARGS: '-e php --colors --show-deprecated ./src'
coding-standards-analysis:
if: ${{ (github.event_name != 'workflow_dispatch') || ((github.event.inputs.jobs == 'Run all') || (github.event.inputs.jobs == 'Run PHPCS only') || (github.event.inputs.jobs == 'Run static analysis')) }}
uses: inpsyde/reusable-workflows/.github/workflows/coding-standards-php.yml@main
with:
PHP_VERSION: '8.3'
static-code-analysis:
if: ${{ (github.event_name != 'workflow_dispatch') || ((github.event.inputs.jobs == 'Run all') || (github.event.inputs.jobs == 'Run Psalm only') || (github.event.inputs.jobs == 'Run static analysis')) }}
uses: inpsyde/reusable-workflows/.github/workflows/static-analysis-php.yml@main
strategy:
matrix:
php: [ '8.1', '8.2', '8.3' ]
with:
PHP_VERSION: ${{ matrix.php }}
PSALM_ARGS: --output-format=github --no-suggestions --no-cache --no-diff --find-unused-psalm-suppress
unit-tests:
if: ${{ (github.event_name != 'workflow_dispatch') || ((github.event.inputs.jobs == 'Run all') || (github.event.inputs.jobs == 'Run unit tests only')) }}
uses: inpsyde/reusable-workflows/.github/workflows/tests-unit-php.yml@main
strategy:
matrix:
php: [ '8.1', '8.2', '8.3' ]
with:
PHP_VERSION: ${{ matrix.php }}
PHPUNIT_ARGS: '--no-coverage'
mutation-tests:
if: ${{ (github.event_name != 'workflow_dispatch') || ((github.event.inputs.jobs == 'Run all') || (github.event.inputs.jobs == 'Run mutation tests only')) }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
tools: infection
- uses: ramsey/composer-install@v3
- run: infection --min-covered-msi=96 --no-progress --log-verbosity=none --threads=max