Skip to content

Commit

Permalink
update dependencies (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
mimmi20 authored Aug 17, 2021
1 parent 3f83d57 commit 78820d1
Show file tree
Hide file tree
Showing 8 changed files with 103 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*.ini text eol=lf
*.sh text eol=lf
*.tmp text eol=lf
LICENSE text eol=lf

# binary files
*.zip -text binary
Expand All @@ -30,6 +29,7 @@ LICENSE text eol=lf
codecov.yml export-ignore text eol=lf
infection.json export-ignore text eol=lf
phpcs.xml export-ignore text eol=lf
phpmd.ruleset.xml export-ignore text eol=lf
phpstan.neon export-ignore text eol=lf
phpunit.xml export-ignore text eol=lf
/tests export-ignore
Expand Down
67 changes: 58 additions & 9 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
name: "Continuous Integration"

env:
PHP_EXTENSIONS: "json, mbstring, opcache"
PHP_EXTENSIONS: "json, opcache, mbstring"
PHP_INI_VALUES: "opcache.enable=1, opcache.enable_cli=1, opcache.fast_shutdown=0, zend.assertions=1, assert.exception=On, intl.default_locale=de, intl.use_exceptions=1"

jobs:
Expand Down Expand Up @@ -108,7 +108,7 @@ jobs:
php-cs-fixer:
name: "Check Coding Standards with PHP-CS-Fixer"

needs: "install"
needs: "validate"

runs-on: "${{ matrix.operating-system }}"

Expand Down Expand Up @@ -160,7 +160,7 @@ jobs:
phpcs:
name: "Check Coding Standards with PHPCS"

needs: "install"
needs: "validate"

runs-on: "${{ matrix.operating-system }}"

Expand Down Expand Up @@ -212,7 +212,7 @@ jobs:
static-code-analysis:
name: "Static Code Analysis with PHPStan"

needs: "install"
needs: "validate"

runs-on: "${{ matrix.operating-system }}"

Expand Down Expand Up @@ -259,14 +259,66 @@ jobs:
- name: "Run phpstan/phpstan"
run: "vendor/bin/phpstan analyse -c phpstan.neon --memory-limit=768M --no-progress"

phpmd:
name: "Check Rules with PHPMD"

needs: "validate"

runs-on: "${{ matrix.operating-system }}"

continue-on-error: false

strategy:
fail-fast: false

matrix:
operating-system:
- "ubuntu-20.04"

php-version:
- "7.4"

dependencies:
- ""

steps:
- name: "Checkout"
uses: "actions/checkout@v2.3.4"

- name: "Install PHP"
uses: "shivammathur/setup-php@2.12.0"
with:
php-version: "${{ matrix.php-version }}"
extensions: "${{ env.PHP_EXTENSIONS }}"
ini-values: "${{ env.PHP_INI_VALUES }}"
coverage: "none"
tools: "composer:v2, phpmd"

- name: "Determine composer cache directory"
id: "determine-composer-cache-directory"
run: "echo \"::set-output name=directory::$(composer config cache-dir)\""

- name: "Cache dependencies installed with composer"
uses: "actions/cache@v2.1.6"
with:
path: "${{ steps.determine-composer-cache-directory.outputs.directory }}"
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"

- name: "Update dependencies with composer"
run: "composer update --optimize-autoloader --prefer-dist --prefer-stable --no-progress --no-interaction -v --ansi ${{ matrix.dependencies }}"

- name: "Run phpmd/phpmd"
run: "phpmd src github phpmd.ruleset.xml"

tests:
name: "UnitTests with PHPUnit"

needs: "install"
needs: "validate"

runs-on: "${{ matrix.operating-system }}"

continue-on-error: ${{ matrix.continue-on-error }}
continue-on-error: false

strategy:
fail-fast: false
Expand All @@ -283,9 +335,6 @@ jobs:
dependencies:
- ""

continue-on-error:
- false

steps:
- name: "Checkout"
uses: "actions/checkout@v2.3.4"
Expand Down
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@
},
"require-dev": {
"mimmi20/coding-standard": "^2.4.2",
"pepakriz/phpstan-exception-rules": "^0.11.7",
"phpstan/extension-installer": "^1.1.0",
"phpstan/phpstan": "^0.12.94",
"phpstan/phpstan-deprecation-rules": "^0.12.6",
"phpstan/phpstan-phpunit": "^0.12.21",
"phpstan/phpstan-phpunit": "^0.12.22",
"phpunit/phpunit": "^9.5.8"
},
"config": {
Expand Down
29 changes: 29 additions & 0 deletions phpmd.ruleset.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0"?>
<ruleset name="mimmi20-cs"
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>The coding standard.</description>

<rule ref="rulesets/cleancode.xml">
<exclude name="BooleanArgumentFlag"/>
<exclude name="ElseExpression"/>
<exclude name="MissingImport"/>
<exclude name="StaticAccess"/>
</rule>

<rule ref="rulesets/codesize.xml">
<exclude name="CyclomaticComplexity"/>
<exclude name="NPathComplexity"/>
</rule>

<rule ref="rulesets/controversial.xml"/>
<rule ref="rulesets/design.xml"/>

<rule ref="rulesets/naming.xml/ConstantNamingConventions"/>

<rule ref="rulesets/unusedcode.xml">
<exclude name="UnusedFormalParameter"/>
</rule>
</ruleset>
16 changes: 11 additions & 5 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,16 @@ parameters:
- %currentWorkingDirectory%/vendor/autoload.php
- %currentWorkingDirectory%/vendor/squizlabs/php_codesniffer/autoload.php
- %currentWorkingDirectory%/vendor/squizlabs/php_codesniffer/src/Util/Tokens.php
excludes_analyse:
- */tests/*/data/*
exceptionRules:
reportUnusedCatchesOfUncheckedExceptions: false
uncheckedExceptions: []
checkGenericClassInNonGenericObjectType: false
checkMissingIterableValueType: false
treatPhpDocTypesAsCertain: false
implicitThrows: false
exceptions:
checkedExceptionRegexes:
- '#Exception#'
- '#Throwable#'
check:
missingCheckedExceptionInThrows: true
tooWideThrowType: true
# ignoreErrors:
# - '~Unused @throws ExceptionalJSON\\EncodeErrorException annotation~'
3 changes: 3 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,8 @@
<include>
<directory suffix=".php">src/</directory>
</include>
<report>
<text outputFile="php://stdout" showUncoveredFiles="true" showOnlySummary="false"/>
</report>
</coverage>
</phpunit>
1 change: 0 additions & 1 deletion src/IosBuild.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ final class IosBuild implements IosBuildInterface
*
* @param string $buildCode the build code
*
* @throws BuildException
* @throws NotFoundException
*/
public function getVersion(string $buildCode): string
Expand Down
3 changes: 0 additions & 3 deletions tests/IosBuildTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

namespace IosBuildTest;

use IosBuild\BuildException;
use IosBuild\IosBuild;
use IosBuild\IosData;
use IosBuild\NotFoundException;
Expand All @@ -35,7 +34,6 @@ protected function setUp(): void

/**
* @throws NotFoundException
* @throws BuildException
*
* @dataProvider failVersionDataProvider
*/
Expand Down Expand Up @@ -76,7 +74,6 @@ public function failVersionDataProvider(): array
/**
* @throws ExpectationFailedException
* @throws InvalidArgumentException
* @throws BuildException
* @throws NotFoundException
*
* @dataProvider versionDataProvider
Expand Down

0 comments on commit 78820d1

Please sign in to comment.