Skip to content

Commit

Permalink
add PHP 8.3 to test matrix (MapServer#7097)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmckenna authored Jul 8, 2024
1 parent 8401b7b commit 2088602
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 8 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/build-mapscript-php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@ name: Build and test PHP MapScript
on:
push:
branches:
- 'main'
- '*'
except:
- /^(cherry-pick-)?backport-\d+-to-/
pull_request:
branches:
- '*'
except:
- /^(cherry-pick-)?backport-\d+-to-/

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
Expand All @@ -19,7 +24,7 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
php-version: [8.1, 8.2]
php-version: [8.3, 8.2]
env:
IGNORE_COMPARISON_RESULT_ON_CI: 'true'

Expand Down
15 changes: 11 additions & 4 deletions ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,19 @@ python -m pyflakes .
# run the Python server for the tests
python -m http.server &> /dev/null &

# get phpunit
# get PHPUnit
echo "PHP version"
php -v
cd php && curl -LO https://phar.phpunit.de/phpunit-10.phar
echo "phpunit version"
php phpunit-10.phar --version
PHPVersionMinor=$(php --version | head -n 1 | cut -d " " -f 2 | cut -c 1,3)
if [ ${PHPVersionMinor} -gt 81 ]; then
cd php && curl -LO https://phar.phpunit.de/phpunit-11.phar
echo "PHPUnit version"
php phpunit-11.phar --version
else
cd php && curl -LO https://phar.phpunit.de/phpunit-10.phar
echo "PHPUnit version"
php phpunit-10.phar --version
fi
echo "PHP includes"
php-config --includes

Expand Down
11 changes: 9 additions & 2 deletions msautotest/php/run_test.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
#!/bin/bash

PHPVersionMinor=$(php --version | head -n 1 | cut -d " " -f 2 | cut -c 1,3)
if [ ${PHPVersionMinor} -gt 81 ]; then
PHPUnitVersion=11
else
PHPUnitVersion=10
fi

if test -z $PHP_MAPSCRIPT_SO; then
php phpunit-10.phar .
php phpunit-$PHPUnitVersion.phar .
exit $?
else
php -d "extension=$PHP_MAPSCRIPT_SO" phpunit-10.phar .
php -d "extension=$PHP_MAPSCRIPT_SO" phpunit-$PHPUnitVersion.phar .
exit $?
fi

0 comments on commit 2088602

Please sign in to comment.