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

[WIP] Release/1.6.0 #17

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions .composer-require-checker.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
}
98 changes: 82 additions & 16 deletions .github/workflows/diagnostics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,108 @@ on:
jobs:
build:
runs-on: ubuntu-latest
name: 'PHP: ${{ matrix.php }} Symfony: ${{ matrix.symfony}} Experimental: ${{ matrix.experimental}}'
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: true
matrix:
php: [5.6, 7.1, 7.2, 7.3, 7.4]
include:
- php: '7.4'
symfony: '^4.0'
phpcq_install: 'install'
output: '-o github-action -o default'
experimental: false
- php: '7.4'
symfony: '^5.0'
phpcq_install: 'update'
output: '-o github-action -o default'
experimental: false
- php: '8.0'
symfony: '^4.0'
phpcq_install: 'update'
output: '-o github-action -o default'
experimental: false
- php: '8.0'
symfony: '^5.0'
phpcq_install: 'update'
output: '-o github-action -o default'
experimental: false
- php: '8.1'
symfony: '^5.0'
phpcq_install: 'update'
output: '-o github-action -o default'
experimental: false
- php: '8.1'
symfony: '^6.0'
phpcq_install: 'update'
output: '-o github-action -o default'
experimental: false
- php: '8.2'
symfony: '^6.0'
phpcq_install: 'update'
output: '-o github-action -o default'
experimental: false
- php: '8.3'
symfony: '^6.0'
phpcq_install: 'update'
output: '-o github-action -o default'
experimental: true

steps:
- name: PHP ${{ matrix.php }} Pull source
- name: Pull source
uses: actions/checkout@v2
with:
fetch-depth: 0

# see https://github.com/shivammathur/setup-php
- name: PHP ${{ matrix.php }} Setup PHP.
- name: Setup PHP with PECL extension
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none

- name: PHP ${{ matrix.php }} Cache composer cache directory
# setup caches
- name: Cache composer cache directory
uses: actions/cache@v1
env:
cache-name: composer-cache-dir
with:
path: ~/.cache/composer
key: ${{ runner.os }}-build-${{ env.cache-name }}
key: ${{ runner.os }}-${{ matrix.php }}-build-${{ env.cache-name }}

- name: PHP ${{ matrix.php }} Cache vendor directory
- name: Cache vendor directory
uses: actions/cache@v1
env:
cache-name: composer-vendor
cache-name: vendor
with:
path: vendor
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/composer.lock') }}
key: ${{ runner.os }}-${{ matrix.php }}-${{ matrix.symfony }}-build-${{ env.cache-name }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
- name: PHP ${{ matrix.php }} Install composer dependencies
run: composer update --prefer-dist --no-interaction --no-suggest
${{ runner.os }}-${{ matrix.php }}-${{ matrix.symfony }}-build-${{ env.cache-name }}-

- name: PHP ${{ matrix.php }} Run tests
run: ant -keep-going
- name: Cache phpcq directory
uses: actions/cache@v1
env:
cache-name: phpcq
with:
path: .phpcq
key: ${{ runner.os }}-${{ matrix.php }}-build-${{ env.cache-name }}-${{ hashFiles('**/.phpcq.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.php }}-build-${{ env.cache-name }}-

# install dependencies and tools
- name: Install composer dependencies
run: |
composer require symfony/process ${{ matrix.symfony }} --no-update
composer require symfony/filesystem ${{ matrix.symfony }} --no-update
composer install
- name: Install phpcq toolchain
run: ./vendor/bin/phpcq ${{ matrix.phpcq_install }} -v

# run tests
- name: Run tests
run: ./vendor/bin/phpcq run -v ${{ matrix.output }}

- name: Upload build directory to artifact
uses: actions/upload-artifact@v2
if: ${{ success() }} || ${{ failure() }}
with:
name: phpcq-builds-php-${{ matrix.php }}-${{ matrix.symfony }}
path: .phpcq/build/
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,8 @@
/vendor/
/composer.phar
/composer.lock

# phpcq related
.phpcq.lock
.phpcq
.phpunit.result.cache
113 changes: 113 additions & 0 deletions .phpcq.yaml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
phpcq:
repositories:
- https://phpcq.github.io/repository/repository.json
directories:
- src
- tests
artifact: .phpcq/build

plugins:
phpunit:
version: ^1.0
signed: false
psalm:
version: ^1.1
signed: false
composer-require-checker:
version: ^1.0
signed: false
requirements:
composer-require-checker:
signed: false
version: ^3.3
phpmd:
version: ^1.0
signed: false
requirements:
phpmd:
signed: false
phpcpd:
version: ^1.0
signed: false
requirements:
phpcpd:
version: ^6.0
phploc:
version: ^1.0
signed: false
phpcs:
version: ^1.0
signed: false
composer-normalize:
version: ^1.0
signed: false
trusted-keys:
# [email protected]
- 4AA394086372C20A
# psalm
- 8A03EA3B385DBAA1
- 12CE0F1D262429A5
# [email protected]
- D2CCAC42F6295E7D
# PHP_CodeSniffer
- 31C7E470E2138192
# Composer normalize
- C00543248C87FB13
# phpmd
- 0F9684B8B16B7AB0
- A4E55EA12C7C085C
# composer-require-checker
- 033E5F8D801A2F8D

tasks:
fix:
- composer-normalize-fix
- phpcbf
verify:
- composer-require-checker
- composer-normalize
analyze:
- phploc
- phpcpd
- phpmd
- phpcs
- psalm
- phpunit
default:
- verify
- analyze

phpmd:
plugin: phpmd
config:
excluded: [ tests ]
ruleset:
- ./.phpmd.xml

composer-normalize-fix:
plugin: composer-normalize
config:
dry_run: false

composer-require-checker:
plugin: composer-require-checker
config:
config_file: '.composer-require-checker.json'

phpcs:
plugin: phpcs
config: &phpcs-config
standard: PSR12
excluded: [ tests ]
custom_flags:
- '--extensions=php'

phpcbf:
plugin: phpcs
config:
<<: *phpcs-config

phpcpd:
plugin: phpcpd
config:
exclude: [ src/Command ]
37 changes: 37 additions & 0 deletions .phpmd.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0"?>
<ruleset name="PHPMD rule set"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation=" http://pmd.sf.net/ruleset_xml_schema.xsd">
<description>
PHPMD rule set
</description>

<rule ref="rulesets/codesize.xml"/>
<rule ref="rulesets/controversial.xml">
<exclude name="CamelCaseVariableName"/>
</rule>
<rule ref="rulesets/controversial.xml/CamelCaseVariableName">
<properties>
<property name="allow-underscore" value="true"/>
</properties>
</rule>
<rule ref="rulesets/design.xml"/>
<rule ref="rulesets/naming.xml">
<exclude name="ShortVariable" />
</rule>
<rule ref="rulesets/naming.xml/ShortVariable">
<properties>
<property name="exceptions" value="id" />
</properties>
</rule>
<rule ref="rulesets/unusedcode.xml">
<exclude name="UnusedLocalVariable"/>
</rule>
<rule ref="rulesets/unusedcode.xml/UnusedLocalVariable">
<properties>
<property name="allow-unused-foreach-variables" value="true"/>
</properties>
</rule>
</ruleset>
11 changes: 0 additions & 11 deletions build.default.properties

This file was deleted.

12 changes: 0 additions & 12 deletions build.xml

This file was deleted.

52 changes: 29 additions & 23 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,32 @@
{
"name": "bit3/git-php",
"description": "Easy to use GIT wrapper for PHP.",
"license": "MIT",
"require": {
"php": "^5.6 || ^7.0",
"psr/log": "^1.0",
"symfony/process": "^3.4 || ^4.0 || ^5.0"
},
"require-dev": {
"symfony/filesystem": "^3.4 || ^4.0 || ^5.0",
"phpcq/all-tasks": "^1.1",
"phpunit/phpunit": "^5.0 || ^6.0 || ^7.0"
},
"autoload": {
"psr-4": {
"Bit3\\GitPhp\\": "src",
"Bit3\\GitPhp\\Test\\": "tests"
}
},
"extra": {
"branch-alias": {
"dev-master": "1.5.x-dev"
}
"name": "bit3/git-php",
"description": "Easy to use GIT wrapper for PHP.",
"license": "MIT",
"require": {
"php": "^7.4 || ^8.0",
"psr/log": "^1.0 || ^2.0 || ^3.0",
"symfony/process": "^4.0 || ^5.0 || ^6.0"
},
"require-dev": {
"phpcq/runner-bootstrap": "^1.0@dev",
"symfony/filesystem": "^4.0 || ^5.0 || ^6.0"
},
"autoload": {
"psr-4": {
"Bit3\\GitPhp\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Bit3\\GitPhp\\Test\\": "tests"
}
},
"config": {
"sort-packages": true
},
"extra": {
"branch-alias": {
"dev-release/1.6.0": "1.6.0-dev"
}
}
}
1 change: 1 addition & 0 deletions exception-stubs.phpstub
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php
15 changes: 15 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0"?>
<psalm
errorLevel="8"
resolveFromConfigFile="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
>
<stubs>
<file name="exception-stubs.phpstub"/>
</stubs>
<projectFiles>
<directory name="src"/>
</projectFiles>
</psalm>
Loading