Skip to content

Update PHP versions #103

Update PHP versions

Update PHP versions #103

Workflow file for this run

name: "Continuous Integration"
on:
push:
branches:
- main
paths-ignore:
- '**.md'
- '.editorconfig'
- '.gitattributes'
- '.github/workflows/noverify.yml'
- '.github/workflows/sonar.yml'
- 'LICENSE'
- 'scripts/**'
- 'sonar-project.properties'
pull_request:
paths-ignore:
- '**.md'
- '.editorconfig'
- '.gitattributes'
- '.github/workflows/noverify.yml'
- '.github/workflows/sonar.yml'
- 'LICENSE'
- 'scripts/**'
- 'sonar-project.properties'
# Allow manually triggering the workflow
workflow_dispatch:
inputs:
random-seed:
description: 'PHPUnit''s random seed'
required: false
default: ''
jobs:
unittest:
name: "Run the unit-tests"
runs-on: "ubuntu-latest"
strategy:
matrix:
php-version:
- "7.1"
- "7.2"
- "7.3"
- "7.4"
- "8.1"
- "8.2"
- "8.3"
phpunit-args: ['']
include:
- php-version: "8.1"
phpunit-args: "--order-by random"
- php-version: "8.2"
phpunit-args: "--process-isolation"
steps:
- name: "Checkout"
uses: "actions/checkout@v3"
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
ini-values: "error_reporting=-1, display_errors=On, display_startup_errors=On, zend.assertions=1"
tools: "composer:v2"
php-version: "${{ matrix.php-version }}"
- name: Configure Composer for PHP 8.2
run: composer config platform.php 8.1.99
if: matrix.php-version == '8.2'
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: "Install dependencies"
run: "composer install --no-interaction --no-progress --prefer-dist"
- name: "Run the unit-tests"
if: ${{ !contains(matrix.phpunit-args, '--order-by random') || !github.event.inputs.random-seed }}
run: "composer ut -- ${{ matrix.phpunit-args }}"
- name: "Run the unit-tests with random seed"
if: ${{ contains(matrix.phpunit-args, '--order-by random') && github.event.inputs.random-seed }}
run: "composer ut -- ${{ matrix.phpunit-args }} --random-order-seed ${{ github.event.inputs.random-seed }}"
fulltest:
name: "Run all tests (8.1)"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout"
uses: "actions/checkout@v3"
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
ini-values: "error_reporting=-1, display_errors=On, display_startup_errors=On, zend.assertions=1"
tools: composer:v2, composer-normalize
php-version: "8.1"
- name: "Install dependencies"
run: "composer install --no-interaction --no-progress --prefer-dist"
- name: "Run all tests"
run: "composer test"
- name: "Normalize composer.json"
run: "composer-normalize --dry-run --no-check-lock --no-update-lock"