Skip to content

Tests

Tests #131

Workflow file for this run

name: Tests
on:
#push:
pull_request:
workflow_dispatch:
schedule:
# “At 12:00”
- cron: '0 12 * * *'
jobs:
build:
name: Tests PHP ${{ matrix.php-version }}
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
steps:
- uses: actions/checkout@v4
- name: Validate composer.json and composer.lock
run: composer validate --strict
- name: Setup PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Run test suite
run: |
mkdir ./coverage
php -v > ./coverage/php${{ matrix.php-version }}_output.txt && echo '' >> ./coverage/php${{ matrix.php-version }}_output.txt
./vendor/bin/phpunit -c ./tests/phpunit-${{ matrix.php-version }}.xml --coverage-clover ./coverage/php${{ matrix.php-version }}_coverage.clover >> ./coverage/php${{ matrix.php-version }}_output.txt
cat ./coverage/php${{ matrix.php-version }}_output.txt
- name: Save coverage results
uses: actions/upload-artifact@v4
with:
name: coverage_clover_php-array-to-xml-${{ matrix.php-version }}
path: ./coverage