Skip to content

Commit 6b9b0dd

Browse files
authored
PHP 8.3 (#1392)
* php 8.3 * phing update * php stan args fix --------- Co-authored-by: Jan Staněk <[email protected]>
1 parent db6b25d commit 6b9b0dd

File tree

9 files changed

+249
-118
lines changed

9 files changed

+249
-118
lines changed

.github/workflows/deploy-dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
environment: test-srs.skauting.cz
1515
runs-on: ubuntu-22.04
1616
container:
17-
image: skaut/lebeda:8.1
17+
image: skaut/lebeda:8.3
1818
env:
1919
CONFIG_DATABASE_HOST: ${{ secrets.CONFIG_DATABASE_HOST }}
2020
CONFIG_DATABASE_NAME: ${{ secrets.CONFIG_DATABASE_NAME }}

.github/workflows/deploy-manual.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
environment: ${{ github.event.inputs.environment }}
1818
runs-on: ubuntu-22.04
1919
container:
20-
image: skaut/lebeda:8.1
20+
image: skaut/lebeda:8.3
2121
env:
2222
CONFIG_DATABASE_HOST: ${{ secrets.CONFIG_DATABASE_HOST }}
2323
CONFIG_DATABASE_NAME: ${{ secrets.CONFIG_DATABASE_NAME }}

.github/workflows/deploy-staging.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
environment: srs.skauting.cz
1414
runs-on: ubuntu-22.04
1515
container:
16-
image: skaut/lebeda:8.1
16+
image: skaut/lebeda:8.3
1717
env:
1818
CONFIG_DATABASE_HOST: ${{ secrets.CONFIG_DATABASE_HOST }}
1919
CONFIG_DATABASE_NAME: ${{ secrets.CONFIG_DATABASE_NAME }}

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
name: "Create release package"
1010
runs-on: ubuntu-22.04
1111
container:
12-
image: skaut/lebeda:8.1
12+
image: skaut/lebeda:8.3
1313
steps:
1414
- uses: actions/checkout@v4
1515
# Copy & paste from https://github.com/actions/cache/blob/master/examples.md#php---composer

.github/workflows/test.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
name: "Build"
1616
runs-on: ubuntu-22.04
1717
container:
18-
image: skaut/lebeda:8.1
18+
image: skaut/lebeda:8.3
1919
steps:
2020
- uses: actions/checkout@v4
2121
# Copy & paste from https://github.com/actions/cache/blob/master/examples.md#php---composer
@@ -62,7 +62,7 @@ jobs:
6262
name: "Unit tests"
6363
runs-on: ubuntu-22.04
6464
container:
65-
image: skaut/lebeda:8.1
65+
image: skaut/lebeda:8.3
6666
needs: workdir
6767
steps:
6868
- name: Download workdir
@@ -115,7 +115,7 @@ jobs:
115115
name: "PHPStan analysis"
116116
runs-on: ubuntu-22.04
117117
container:
118-
image: skaut/lebeda:8.1
118+
image: skaut/lebeda:8.3
119119
needs: workdir
120120
steps:
121121
- name: Download workdir
@@ -131,7 +131,7 @@ jobs:
131131
name: "Coding standard"
132132
runs-on: ubuntu-22.04
133133
container:
134-
image: skaut/lebeda:8.1
134+
image: skaut/lebeda:8.3
135135
needs: workdir
136136
steps:
137137
- name: Download workdir
@@ -147,7 +147,7 @@ jobs:
147147
name: "Doctrine checks"
148148
runs-on: ubuntu-22.04
149149
container:
150-
image: skaut/lebeda:8.1
150+
image: skaut/lebeda:8.3
151151
services:
152152
mysql-test:
153153
image: mysql:8.0

build.xml

Lines changed: 75 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,36 @@
22
<project name="SRS" basedir="." default="main">
33
<property name="tempDir" value="temp"/>
44
<target name="main" description="Runs tests and prepares deployable tarball">
5-
<exec command="composer install" passthru="true"/>
5+
<exec executable="composer" passthru="true">
6+
<arg value="install"/>
7+
</exec>
8+
69
<phingcall target="static-analysis"/>
710
<phingcall target="coding-standard"/>
8-
<exec command="php www/index.php orm:validate-schema --skip-sync"/>
11+
12+
<exec executable="php">
13+
<arg value="www/index.php"/>
14+
<arg value="orm:validate-schema"/>
15+
<arg value="--skip-sync"/>
16+
</exec>
17+
918
<phingcall target="tests"/>
1019
</target>
1120

1221
<target name="prepare-tarball" description="Prepares deployable tarball with everything built">
13-
<exec command="git rev-parse --short HEAD" outputProperty="build.hash"/>
22+
<exec executable="git" outputProperty="build.hash">
23+
<arg value="rev-parse"/>
24+
<arg value="--short HEAD"/>
25+
</exec>
26+
1427
<property name="build.dir" value="${tempDir}/builds/${build.hash}"/>
1528

16-
<exec command="yarn install" passthru="true"/>
17-
<exec command="yarn build" passthru="true"/>
29+
<exec executable="yarn" passthru="true">
30+
<arg value="install"/>
31+
</exec>
32+
<exec executable="yarn" passthru="true">
33+
<arg value="build"/>
34+
</exec>
1835

1936
<delete dir="${build.dir}"/>
2037
<mkdir dir="${build.dir}"/>
@@ -58,12 +75,14 @@
5875
</filterchain>
5976
</copy>
6077

61-
<exec command="composer --working-dir=${build.dir} install
62-
--no-interaction
63-
--optimize-autoloader
64-
--classmap-authoritative
65-
--no-dev"
66-
passthru="true"/>
78+
<exec executable="composer" passthru="true">
79+
<arg value="--working-dir=${build.dir}"/>
80+
<arg value="install"/>
81+
<arg value="--no-interaction"/>
82+
<arg value="--optimize-autoloader"/>
83+
<arg value="--classmap-authoritative"/>
84+
<arg value="--no-dev"/>
85+
</exec>
6786

6887
<delete>
6988
<fileset dir="${build.dir}">
@@ -91,14 +110,21 @@
91110
<target name="deploy:ssh">
92111
<echo message="${comment}..."/>
93112
<echo message="${command}"/>
94-
<exec command="ssh ${deploy.ssh.target} -p ${deploy.ssh.port} '${command}'" passthru="true" checkreturn="true"/>
113+
<exec executable="ssh" passthru="true" checkreturn="true">
114+
<arg value="${deploy.ssh.target}"/>
115+
<arg value="-p ${deploy.ssh.port}"/>
116+
<arg value="'${command}'"/>
117+
</exec>
95118
</target>
96119

97120
<target name="deploy:copy-tarball">
98-
<property name="command" value="scp -P ${port} ${file} '${target}:${toDirectory}'"/>
121+
<property name="command" value="scp"/>
122+
<property name="args" value="-P ${port} ${file} '${target}:${toDirectory}'"/>
99123
<echo message="Copying files to ${deploy.ssh.target}"/>
100-
<echo message="${command}"/>
101-
<exec command="${command}" passthru="true" checkreturn="true"/>
124+
<echo message="${command} ${args}"/>
125+
<exec executable="${command}" passthru="true" checkreturn="true">
126+
<arg value="${args}"/>
127+
</exec>
102128
</target>
103129

104130
<target name="deploy:cleanup">
@@ -121,7 +147,10 @@
121147
<property environment="env"/>
122148
<property name="deploy.workDir" refid="env.DEPLOY_DIRECTORY"/>
123149
<property name="deploy.releasesDir" value="${deploy.workDir}/releases"/>
124-
<exec command="git rev-parse --short HEAD" outputProperty="build.hash"/>
150+
<exec executable="git" outputProperty="build.hash">
151+
<arg value="rev-parse"/>
152+
<arg value="--short HEAD"/>
153+
</exec>
125154
<property name="deploy.lebeda" refid="env.DEPLOY_LEBEDA"/>
126155
<property name="deploy.ssh.host" refid="env.DEPLOY_SSH_HOST"/>
127156
<property name="deploy.ssh.username" refid="env.DEPLOY_SSH_USERNAME"/>
@@ -244,15 +273,24 @@
244273
</target>
245274

246275
<target name="tests-unit">
247-
<exec command="vendor/bin/codecept run unit" passthru="true" checkreturn="true"/>
276+
<exec executable="vendor/bin/codecept" passthru="true" checkreturn="true">
277+
<arg value="run"/>
278+
<arg value="unit"/>
279+
</exec>
248280
</target>
249281

250282
<target name="tests-integration">
251-
<exec command="vendor/bin/codecept run integration" passthru="true" checkreturn="true"/>
283+
<exec executable="vendor/bin/codecept" passthru="true" checkreturn="true">
284+
<arg value="run"/>
285+
<arg value="integration"/>
286+
</exec>
252287
</target>
253288

254289
<target name="tests-performance">
255-
<exec command="vendor/bin/codecept run performance" passthru="true" checkreturn="true"/>
290+
<exec executable="vendor/bin/codecept" passthru="true" checkreturn="true">
291+
<arg value="run"/>
292+
<arg value="performance"/>
293+
</exec>
256294
</target>
257295

258296
<target name="tests">
@@ -261,16 +299,29 @@
261299
</target>
262300

263301
<target name="tests-with-coverage">
264-
<exec command="php -d zend_extension=xdebug.so -d xdebug.mode=coverage vendor/bin/codecept run unit,integration --coverage-xml"
265-
passthru="true" checkreturn="true"/>
302+
<exec executable="php" passthru="true" checkreturn="true">
303+
<arg value="-d zend_extension=xdebug.so"/>
304+
<arg value="-d xdebug.mode=coverage"/>
305+
<arg value="vendor/bin/codecept"/>
306+
<arg value="run"/>
307+
<arg value="unit,integration"/>
308+
<arg value="--coverage-xml"/>
309+
</exec>
266310
</target>
267311

268312
<target name="static-analysis">
269-
<exec command="php -d memory_limit=1024M vendor/bin/phpstan analyse -l 6 -c phpstan.neon app --no-progress"
270-
passthru="true" checkreturn="true"/>
313+
<exec executable="php" passthru="true" checkreturn="true">
314+
<arg value="-d memory_limit=1024M"/>
315+
<arg value="vendor/bin/phpstan"/>
316+
<arg value="analyse"/>
317+
<arg value="-l6"/>
318+
<arg value="-cphpstan.neon"/>
319+
<arg value="app"/>
320+
<arg value="--no-progress"/>
321+
</exec>
271322
</target>
272323

273324
<target name="coding-standard">
274-
<exec command="vendor/bin/phpcs" passthru="true" checkreturn="true"/>
325+
<exec executable="vendor/bin/phpcs" passthru="true" checkreturn="true"/>
275326
</target>
276327
</project>

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
],
1010

1111
"require": {
12-
"php": ">=8.1",
12+
"php": ">=8.3",
1313
"ext-bcmath": "*",
1414
"ext-fileinfo": "*",
1515
"ext-iconv": "*",

0 commit comments

Comments
 (0)