Test on PHP 8.3 #114
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
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions | |
name: "Build" | |
on: | |
pull_request: | |
push: | |
branches: | |
- "master" | |
jobs: | |
lint: | |
name: "Lint" | |
runs-on: "ubuntu-latest" | |
strategy: | |
matrix: | |
php-version: | |
- "8.1" | |
- "8.2" | |
- "8.3" | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v4" | |
- name: "Install PHP" | |
uses: "shivammathur/setup-php@v2" | |
with: | |
coverage: "none" | |
php-version: "${{ matrix.php-version }}" | |
tools: composer:v2 | |
- name: "Cache dependencies" | |
uses: "actions/cache@v4" | |
with: | |
path: "~/.composer/cache" | |
key: "php-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}" | |
restore-keys: "php-${{ matrix.php-version }}-composer-" | |
- name: "Install dependencies" | |
run: "composer update --prefer-dist --no-interaction --no-progress --no-suggest" | |
- name: "Lint" | |
run: "composer run check:lint" | |
coding-standards: | |
name: "Coding standards" | |
runs-on: "ubuntu-latest" | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v4" | |
- name: "Install PHP" | |
uses: "shivammathur/setup-php@v2" | |
with: | |
coverage: "none" | |
php-version: "8.3" | |
tools: composer:v2 | |
- name: "Cache dependencies" | |
uses: "actions/cache@v4" | |
with: | |
path: "~/.composer/cache" | |
key: "php-8.3-composer-${{ hashFiles('**/composer.json') }}" | |
restore-keys: "php-8.3-composer-" | |
- name: "Install dependencies" | |
run: "composer update --prefer-dist --no-interaction --no-progress --no-suggest" | |
- name: "Lint" | |
run: "composer run check:lint" | |
- name: "Coding Standard" | |
run: "composer run check:cs" | |
static-analysis: | |
name: "Static analysis" | |
runs-on: "ubuntu-latest" | |
strategy: | |
matrix: | |
php-version: | |
- "8.1" | |
- "8.2" | |
- "8.3" | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v4" | |
- name: "Install PHP" | |
uses: "shivammathur/setup-php@v2" | |
with: | |
coverage: "none" | |
php-version: "${{ matrix.php-version }}" | |
tools: composer:v2 | |
- name: "Cache dependencies" | |
uses: "actions/cache@v4" | |
with: | |
path: "~/.composer/cache" | |
key: "php-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}" | |
restore-keys: "php-${{ matrix.php-version }}-composer-" | |
- name: "Install dependencies" | |
run: "composer update --prefer-dist --no-interaction --no-progress --no-suggest" | |
- name: "PHPStan" | |
run: "composer run check:types" | |
tests: | |
name: "Tests" | |
runs-on: ${{ matrix.operating-system }} | |
strategy: | |
matrix: | |
dependencies: ["lowest", "highest"] | |
php-version: | |
- "8.1" | |
- "8.2" | |
- "8.3" | |
operating-system: ["ubuntu-latest", "windows-latest"] | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v4" | |
- name: "Install PHP" | |
uses: "shivammathur/setup-php@v2" | |
with: | |
coverage: "none" | |
php-version: "${{ matrix.php-version }}" | |
extensions: mbstring | |
- name: "Cache dependencies" | |
uses: "actions/cache@v4" | |
with: | |
path: "~/.composer/cache" | |
key: "php-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}" | |
restore-keys: "php-${{ matrix.php-version }}-composer-" | |
- name: "Install lowest dependencies" | |
if: ${{ matrix.dependencies == 'lowest' }} | |
run: "composer update --prefer-lowest --prefer-dist --no-interaction --no-progress --no-suggest" | |
- name: "Install highest dependencies" | |
if: ${{ matrix.dependencies == 'highest' }} | |
run: "composer update --prefer-dist --no-interaction --no-progress --no-suggest" | |
- name: "Tests" | |
run: "composer run check:tests" | |
code-coverage: | |
name: "Code coverage" | |
runs-on: "ubuntu-latest" | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v4" | |
with: | |
fetch-depth: 5 | |
- name: "Install PHP" | |
uses: "shivammathur/setup-php@v2" | |
with: | |
coverage: "pcov" | |
php-version: "8.3" | |
tools: pecl | |
- name: "Cache dependencies" | |
uses: "actions/cache@v4" | |
with: | |
path: "~/.composer/cache" | |
key: "php-8.3-composer-${{ hashFiles('**/composer.json') }}" | |
restore-keys: "php-8.3-composer-" | |
- name: "Install dependencies" | |
run: "composer update --prefer-dist --no-interaction --no-progress --no-suggest" | |
- name: "Tests" | |
run: "composer run check:tests" | |
- name: "Upload to Codecov.io" | |
env: | |
CODECOV_TOKEN: "${{ secrets.CODECOV }}" | |
run: "bash <(curl -s https://codecov.io/bash) -f build/log/clover.xml" |