Skip to content

Commit b477c1b

Browse files
committed
improve CI scripts to install the right PHP version
1 parent 1a9f225 commit b477c1b

File tree

2 files changed

+21
-15
lines changed

2 files changed

+21
-15
lines changed

.github/scripts/syntax-check.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
set -e
44

5+
php -v
6+
57
for f in `find -name '*.php' -not -path './vendor/*'` ; do
6-
php$PHP_VERSION -l $f
8+
php -l $f
79
done

.github/workflows/build.yml

+18-14
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,35 @@ jobs:
1010
strategy:
1111
matrix:
1212
os: [ubuntu-24.04]
13-
phpversion: [""]
13+
phpversion: ["7.4", "8.0", "8.1", "8.2", "8.3", "8.4"]
1414

1515
steps:
1616
- name: Checkout code
1717
uses: actions/checkout@v4
1818

19-
- name: Install dependencies
20-
run: |
21-
wget https://getcomposer.org/installer -O composer-setup.php
22-
php${{ matrix.phpversion }} composer-setup.php
23-
rm composer-setup.php
24-
php${{ matrix.phpversion }} composer.phar update
25-
cp config.php.in config.php
19+
- name: Setup PHP
20+
uses: shivammathur/setup-php@v2
21+
with:
22+
php-version: ${{ matrix.phpversion }}
23+
coverage: none
24+
25+
- name: Install Composer
26+
uses: ramsey/composer-install@v3
27+
28+
- name: Copy config
29+
run: cp config.php.in config.php
30+
31+
- name: Show PHP version
32+
run: php -v
2633

2734
- name: Syntax checker
2835
run: ./.github/scripts/syntax-check.sh
2936

3037
- name: Run Install script
31-
run: php${{ matrix.phpversion }} doctrine.php orm:schema-tool:create
38+
run: php doctrine.php orm:schema-tool:create
3239

3340
- name: Generate proxies
34-
run: php${{ matrix.phpversion }} doctrine.php orm:generate-proxies
41+
run: php doctrine.php orm:generate-proxies
3542

3643
- name: Check ORM mapping
37-
run: php${{ matrix.phpversion }} doctrine.php orm:validate-schema |& grep "The mapping files are correct"
38-
39-
env:
40-
PHP_VERSION: ${{ matrix.phpversion }}
44+
run: php doctrine.php orm:validate-schema |& grep "The mapping files are correct"

0 commit comments

Comments
 (0)