Merge pull request #171 from supermetrics-public/release/1.0.1 #432
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
release: | |
types: [created] | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
name: Build and test | |
strategy: | |
fail-fast: false | |
matrix: | |
php: [7.4, 8.0, 8.1, 8.2, 8.3] | |
use-opcache: [true, false] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: "${{ matrix.php }}" | |
coverage: none | |
tools: pecl | |
- name: Compile | |
run: ./.build-scripts/compile.sh | |
- name: Find PHP | |
run: | | |
TEST_PHP_EXECUTABLE=`make findphp` | |
echo "Found PHP in: $TEST_PHP_EXECUTABLE" | |
echo "TEST_PHP_EXECUTABLE=$TEST_PHP_EXECUTABLE" >> $GITHUB_ENV | |
- name: Define PHP arguments | |
run: | | |
TEST_PHP_ARGS="-n" | |
[[ "${{ matrix.use-opcache }}" != "true" ]] || TEST_PHP_ARGS="$TEST_PHP_ARGS -d zend_extension=opcache.so -d opcache.enable=1 -d opcache.enable_cli=1" | |
TEST_PHP_ARGS="$TEST_PHP_ARGS -d extension=$PWD/modules/jsonpath.so" | |
echo "Test PHP arguments: $TEST_PHP_ARGS" | |
echo "TEST_PHP_ARGS=$TEST_PHP_ARGS" >> $GITHUB_ENV | |
- name: Run tests | |
run: | | |
$TEST_PHP_EXECUTABLE $TEST_PHP_ARGS -v | |
$TEST_PHP_EXECUTABLE -n run-tests.php -q -x --show-diff | |
- name: Show errors | |
if: ${{ failure() }} | |
run: ./.build-scripts/show-errors.sh |