Skip to content

Commit

Permalink
Merge pull request #44 from fr3nch13/2.x-dev
Browse files Browse the repository at this point in the history
Moving to github workflows and initial support for php 8.x
  • Loading branch information
fr3nch13 committed Feb 7, 2023
2 parents 8f0a40a + c0b6bd6 commit 4f1c743
Show file tree
Hide file tree
Showing 8 changed files with 106 additions and 6,468 deletions.
98 changes: 98 additions & 0 deletions .github/workflows/ci.yml
@@ -0,0 +1,98 @@
name: CI

on:
pull_request:
branches:
- '*'

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
php-version: ['7.4', '8.0', '8.1', '8.2']
name: Test PHP ${{ matrix.php-version }}

steps:
- uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, intl
coverage: none

- name: Composer install
run: composer install

- name: Run PHPUnit
run: composer run-script test

coverage-php:
runs-on: ubuntu-22.04
name: Coverage

steps:
- uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
extensions: mbstring, intl
coverage: pcov

- name: Composer install
run: composer install

- name: Run PHPUnit
run: composer run-script coverage

coding-standard:
name: Coding Standard
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
extensions: mbstring, intl
coverage: none

- name: Composer install
run: composer install

- name: Run PHP CodeSniffer
run: composer run-script cs-checkstyle | vendor/bin/cs2pr

static-analysis:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
php-version: ['7.4', '8.0', '8.1', '8.2']
name: Static Analysis - PHP ${{ matrix.php-version }}

steps:
- uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, intl
coverage: none

- name: Composer install
run: composer install

- name: Run PHP Analyzer
run: composer run-script phpstan
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -11,3 +11,5 @@ docs/**/*.php
!/tests/test_app/tmp/*.gitkeep
.phpunit.result.cache
tests/test_app/config/.env
.vscode
composer.lock
2 changes: 1 addition & 1 deletion .scrutinizer.yml
Expand Up @@ -15,7 +15,7 @@ build:
tests:
override:
-
command: composer coverage-clover
command: composer run-script coverage-clover
coverage:
file: tmp/coverage.xml
format: clover
Expand Down
37 changes: 0 additions & 37 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .vscode/settings.json
@@ -1,3 +1,3 @@
{
"php.version": "7.4.33"
"php.version": "v8.0"
}
7 changes: 4 additions & 3 deletions composer.json
Expand Up @@ -15,7 +15,7 @@
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": "^7.4",
"php": "~7.4|~8.0",
"cakephp/bake": "^2.8",
"cakephp/cakephp": "~4.4.8",
"cakephp/cakephp-codesniffer": "~4.6",
Expand All @@ -29,7 +29,7 @@
"phpcompatibility/php-compatibility": "^9.3",
"phpstan/phpstan": "^1.9",
"phpunit/phpunit": "^9.5",
"psy/psysh": "@stable"
"staabm/annotate-pull-request-from-checkstyle": "^1.8"
},
"autoload": {
"psr-4": {
Expand Down Expand Up @@ -62,8 +62,9 @@
"@cs-check"
],
"cs-check": "php -d memory_limit=-1 ./vendor/bin/phpcs --colors -p -s --extensions=php ./src ./tests ./config",
"cs-checkstyle": "php -d memory_limit=-1 ./vendor/bin/phpcs --report=checkstyle --extensions=php ./src ./tests ./config",
"cs-fix": "php -d memory_limit=-1 ./vendor/bin/phpcbf --colors --extensions=php ./src ./tests ./config",
"phpstan": "php -d memory_limit=-1 ./vendor/bin/phpstan --no-progress -vvv",
"phpstan": "php -d memory_limit=-1 ./vendor/bin/phpstan --no-progress -vvv --error-format=github",
"test": "php -d memory_limit=-1 ./vendor/bin/phpunit --colors=always",
"coverage": "php -d memory_limit=-1 -d xdebug.mode=coverage ./vendor/bin/phpunit --log-junit tmp/coverage/unitreport.xml --coverage-html tmp/coverage",
"coverage-clover": "php -d memory_limit=-1 -d xdebug.mode=coverage ./vendor/bin/phpunit --coverage-clover=tmp/coverage.xml",
Expand Down

0 comments on commit 4f1c743

Please sign in to comment.