Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GitHub Actions to test project from PHP 7.3 to PHP 8.2 #7

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM composer
LABEL maintainer='dario.cancelliere@facile.it'
LABEL maintainer='artoo-dev@facile.it'

RUN apk add --update linux-headers
RUN pecl channel-update pecl.php.net
RUN pecl bundle -d /usr/src/php/ext/ xdebug
RUN docker-php-ext-install xdebug
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: "Tests"

on: [push, pull_request]

jobs:
phpunit:
name: "Tests"
runs-on: "ubuntu-20.04"

strategy:
matrix:
php-version:
- "7.3"
- "7.4"
- "8.0"
- "8.1"
- "8.2"
deps:
- "lowest"
- "highest"
coverage:
- "false"
include:
- deps: "highest"
php-version: "8.2"
davidecaruso marked this conversation as resolved.
Show resolved Hide resolved
coverage: "true"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"
with:
fetch-depth: 2
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
coverage: "pcov"
ini-values: "zend.assertions=1"
- name: "Install dependencies"
uses: ramsey/composer-install@v1
with:
dependency-versions: ${{ matrix.deps }}
composer-options: --prefer-dist
- name: "Run PHPUnit"
run: "vendor/bin/phpunit"
if: "${{ matrix.coverage != 'true' }}"
- name: "Run PHPUnit with coverage"
run: "vendor/bin/phpunit --coverage-clover=coverage.xml"
if: "${{ matrix.coverage == 'true' }}"
- name: "Run PHP-CS-Fixer (E2E test)"
run: "vendor/bin/php-cs-fixer fix --dry-run --diff"
if: "${{ matrix.deps != 'lowest' && matrix.php-version != '8.2' }}"
9 changes: 6 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@
"type": "library",
"license": "proprietary",
"require": {
"php": "^7.1",
"php": "7.3 - 8.2",
"ext-json": "*",
"psr/container": "^1.0"
},
"require-dev": {
"facile-it/facile-coding-standard": "^0.3.1",
"facile-it/facile-coding-standard": "^0.3.1|^0.5.2",
"phpstan/phpstan": "^0.12.8",
"phpunit/phpunit": "^7.5|^8.5"
"phpunit/phpunit": "^7.5|^8.5.23"
},
"config": {
"allow-plugins": {
"facile-it/facile-coding-standard": true
},
"optimize-autoloader": true,
"preferred-install": {
"*": "dist"
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ services:
- ./:/dist/:cached
- ./.docker/xdebug.ini:/usr/local/etc/php/conf.d/xdebug.ini:ro
working_dir: /dist/
command: composer install