Skip to content

Add PHP 8.3 to CI

Add PHP 8.3 to CI #55

name: "Continuous Integration"
on:
- pull_request
- push
jobs:
coding-standards:
name: "Coding Standards"
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@master
- name: "Install PHP 8.2"
uses: shivammathur/setup-php@v2
with:
php-version: "8.2"
extensions: mbstring, xml
coverage: none
tools: composer:v2
- name: "Validate composer.json"
run: composer validate --strict
- name: "Determine Composer cache directory"
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: "Cache dependencies"
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: "Install dependencies with composer"
run: composer install --no-interaction --no-progress
- name: "Run PHP CodeSniffer"
run: vendor/bin/phpcs
static-code-analysis:
name: "Static Code Analysis"
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@master
- name: "Install PHP 8.2"
uses: shivammathur/setup-php@v2
with:
php-version: "8.2"
extensions: mbstring, xml
coverage: none
tools: composer:v2
- name: "Determine Composer cache directory"
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: "Cache dependencies"
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: "Install dependencies with composer"
run: composer install --no-interaction --no-progress --no-plugins
- name: "Run phpstan/phpstan"
run: php vendor/bin/phpstan analyse --level max src tests
tests:
name: "Tests"
runs-on: ubuntu-latest
strategy:
matrix:
php-versions:
- "7.4"
- "8.0"
- "8.1"
- "8.2"
- "8.3"
dependencies:
- lowest
- highest
steps:
- name: "Checkout"
uses: actions/checkout@master
- name: "Install PHP ${{ matrix.php-versions }}"
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php-versions }}"
extensions: mbstring, xml
tools: composer:v2
- name: "Determine Composer cache directory"
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: "Cache dependencies"
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: "Install lowest dependencies with composer"
if: matrix.dependencies == 'lowest'
run: composer update --no-interaction --no-progress --no-plugins --prefer-lowest --ignore-platform-reqs
- name: "Install highest dependencies with composer"
if: matrix.dependencies == 'highest'
run: composer update --no-interaction --no-progress --no-plugins --ignore-platform-reqs
- name: "Run unit tests"
run: vendor/bin/phpunit --verbose
code-coverage:
name: "Code Coverage"
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@master
- name: "Install PHP 8.2"
uses: shivammathur/setup-php@v2
with:
php-version: "8.2"
extensions: mbstring, xml
coverage: xdebug:v3
tools: composer:v2
- name: "Determine Composer cache directory"
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: "Cache dependencies"
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: "Install dependencies with composer"
run: composer install --no-interaction --no-progress --no-plugins
- name: "Collect code coverage with Xdebug and phpunit/phpunit"
run: vendor/bin/phpunit --coverage-clover=build/logs/clover.xml
- name: "Download code coverage uploader for Codecov.io"
run: curl -s https://codecov.io/bash -o codecov
- name: "Send code coverage report to Codecov.io"
run: bash codecov -t ${{ secrets.CODECOV_TOKEN }}