-
Notifications
You must be signed in to change notification settings - Fork 0
195 lines (190 loc) · 7.88 KB
/
verify-stability.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
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
name: Verify stability
on:
push:
branches:
- master
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
Validate:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: [ '8.0', '8.1', '8.2' ]
env:
extensions: dom, fileinfo, intl, json, pcre, simplexml
key: cache-v1 # can be any string, change to clear the extension cache.
steps:
- name: Hello
run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- name: Checkout branch
uses: actions/checkout@v4
- name: Setup cache environment
id: extcache
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.extensions }}
key: ${{ env.key }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.extensions }}
- name: Validate Composer (composer.json and composer.lock)
uses: php-actions/composer@v6
with:
php_version: ${{ matrix.php-versions }}
php_extensions: intl
command: validate --strict --no-check-publish
- name: Cache Composer dependencies
id: composer-cache
uses: actions/cache@v4
with:
path: /tmp/composer-cache
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install Composer dependencies
uses: php-actions/composer@v6
with:
php_version: ${{ matrix.php-versions }}
php_extensions: intl
dev: no
PHPStan:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: [ '8.0', '8.1', '8.2' ]
env:
extensions: dom, fileinfo, intl, json, pcre, simplexml
key: cache-v1 # can be any string, change to clear the extension cache.
needs: [ Validate ]
if: needs.Validate.result == 'success'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup cache environment
id: extcache
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.extensions }}
key: ${{ env.key }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.extensions }}
- name: Install Composer dependencies
uses: php-actions/composer@v6
with:
php_version: ${{ matrix.php-versions }}
php_extensions: intl
- name: Analyse code with PHPStan
run: vendor/bin/phpstan analyse --memory-limit 256M
PHPUnit:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: [ '8.0', '8.1', '8.2' ]
env:
extensions: dom, fileinfo, intl, json, pcre, simplexml
key: cache-v1 # can be any string, change to clear the extension cache.
needs: [ PHPStan ]
if: needs.PHPStan.result == 'success'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup cache environment
id: extcache
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.extensions }}
key: ${{ env.key }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.extensions }}
- name: Install locales
run: |
sudo apt-get update \
&& sudo apt-get install -y --no-install-recommends --fix-missing \
locales
- name: Generate locales
run: |
sudo sed -i "s/^# de_DE/de_DE/g; \
s/^# es_ES/es_ES/g; \
s/^# en_GB/en_GB/g; \
s/^# en_US/en_US/g; \
s/^# fr_FR/fr_FR/g; \
s/^# it_IT/it_IT/g; \
s/^# pl_PL/pl_PL/g; \
s/^# ru_RU/ru_RU/g;" /etc/locale.gen \
&& sudo locale-gen
- name: Install Composer dependencies
uses: php-actions/composer@v6
with:
php_version: ${{ matrix.php-versions }}
php_extensions: intl
- name: Run PHPUnit tests
run: vendor/bin/phpunit --no-coverage
- name: Bye 👋
run: echo "🍏 This job's status is ${{ job.status }}."
# TODO (kn) Remove me
#
# tests:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# php-versions: [ '7.4', '8.0' ]
# # php-versions: [ '7.4', '8.0', '8.1', '8.2' ]
# steps:
# - name: Hello
# run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
# - name: Setup PHP
# uses: shivammathur/setup-php@v2
# with:
# php-version: ${{ matrix.php-versions }}
# extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, mysql, mysqli, pdo_mysql, bcmath, soap, intl, gd, exif, iconv, imagick
# ini-values: date.timezone=Europe/London
# - name: Install locales
# run: |
# sudo apt-get update \
# && sudo apt-get install -y --no-install-recommends --fix-missing \
# locales
# - name: Generate locales
# run: |
# sudo sed -i "s/^# de_DE/de_DE/g; \
# s/^# es_ES/es_ES/g; \
# s/^# en_GB/en_GB/g; \
# s/^# en_US/en_US/g; \
# s/^# fr_FR/fr_FR/g; \
# s/^# it_IT/it_IT/g; \
# s/^# pl_PL/pl_PL/g; \
# s/^# ru_RU/ru_RU/g;" /etc/locale.gen \
# && sudo locale-gen
# - name: Checkout branch
# uses: actions/checkout@v3
# - name: Validate composer.json and composer.lock
# run: composer validate --strict
# - name: Cache Composer packages
# id: composer-cache
# uses: actions/cache@v3
# with:
# path: vendor
# key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
# restore-keys: |
# ${{ runner.os }}-php-
# - name: Install Composer dependencies
# run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --no-plugins --prefer-dist
# - name: Run PHPUnit tests
# run: vendor/bin/phpunit --no-coverage
# - name: Bye 👋
# run: echo "🍏 This job's status is ${{ job.status }}."