Skip to content

Test PHP up to 8.3

Test PHP up to 8.3 #15

Workflow file for this run

name: Test Suite
on:
# Controls when the action will be triggered.
push: # A push to any branch.
pull_request: # A pull request to the trunk (main/master branch).
branches: [ trunk ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
php-tests:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- php: '7.4'
composer-flags: '--prefer-lowest'
- php: '7.4'
- php: '8.0'
composer-flags: '--prefer-lowest'
- php: '8.0'
- php: '8.1'
- php: '8.2'
- php: '8.3'
# Steps represent a sequence of tasks that will be executed as part of the job
name: "PHP${{ matrix.php }} ${{ matrix.composer-flags }}"
steps:
- name: Checkout source
uses: actions/checkout@v2
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
# extensions: json
# ini-values: "post_max_size=256M" #optional
coverage: pcov
- name: Validate composer.json and composer.lock
run: composer validate --strict
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-php-
- name: Update composer dependencies
run: composer update -o --no-interaction --no-progress --prefer-dist ${{ matrix.composer-flags }}
- name: Run TEST suite
run: composer run-script test:ci -- -C --coverage tests/output/coverage.xml --coverage-src=src
#run: vendor/bin/tester tests -C --coverage tests/output/coverage.xml --coverage-src=src
- name: Install php-coveralls
run: composer global require -o --no-interaction --no-progress --prefer-dist php-coveralls/php-coveralls
- name: Upload coverage results to Coveralls
uses: nick-invision/retry@v2
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
COVERALLS_FLAG_NAME: "PHP${{ matrix.php }}"
with:
timeout_seconds: 60
max_attempts: 3
command: php-coveralls -x tests/output/coverage.xml -o tests/output/upload.json -v
coveralls-finish:
needs: php-tests
runs-on: ubuntu-latest
steps:
- name: Notify Coveralls when build is finished
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true