Repository navigation
101 lines (93 loc) · 3.36 KB
/
Copy pathquality.yml
File metadata and controls
101 lines (93 loc) · 3.36 KB
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
100
101
name: Quality
on:
push:
branches:
- main
pull_request:
# Weekly build: the dependencies are not locked, a new version of a dependency may break the build
schedule:
- cron: '0 6 * * 1'
workflow_dispatch:
permissions:
contents: read
# A new push cancels the build of the previous one, on a pull request
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
composer-validate:
name: Composer validate
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Install PHP with extensions
uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # v2
with:
php-version: '8.5'
coverage: none
tools: composer:v2
- name: Validate composer.json
run: composer validate --strict --no-check-lock
phpstan:
name: PHPStan
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Install PHP with extensions
uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # v2
with:
php-version: '8.5'
coverage: none
tools: composer:v2
- name: Install Composer dependencies (locked)
uses: ramsey/composer-install@26d8a556604053a9612623447203a691f406fbe6 # v4
- name: PHPStan
run: vendor/bin/phpstan --no-progress --memory-limit=1G analyse --error-format=github
php-cs-fixer:
name: PHP-CS-Fixer
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Install PHP with extensions
uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # v2
with:
php-version: '8.5'
coverage: none
tools: composer:v2
- name: Install Composer dependencies (locked)
uses: ramsey/composer-install@26d8a556604053a9612623447203a691f406fbe6 # v4
- name: PHP-CS-Fixer
run: vendor/bin/php-cs-fixer fix --diff --dry-run --show-progress=none
rector:
name: Rector
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Install PHP with extensions
uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # v2
with:
php-version: '8.5'
coverage: none
tools: composer:v2
- name: Install Composer dependencies (locked)
uses: ramsey/composer-install@26d8a556604053a9612623447203a691f406fbe6 # v4
- name: Rector
run: vendor/bin/rector --no-progress-bar --dry-run
# Single check to require in the branch protection of main: its name does not depend on the matrix
quality-passed:
name: Quality passed
if: always()
needs: [composer-validate, phpstan, php-cs-fixer, rector]
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Check the result of the jobs
run: test "${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }}" = false