Skip to content

Commit

Permalink
Merge 1a736cf into ada3c7e
Browse files Browse the repository at this point in the history
  • Loading branch information
devanych committed Mar 27, 2023
2 parents ada3c7e + 1a736cf commit a573157
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 36 deletions.
41 changes: 29 additions & 12 deletions .github/workflows/build.yml
@@ -1,6 +1,21 @@
on:
- pull_request
- push
pull_request:
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'psalm.xml.dist'

push:
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'psalm.xml.dist'

name: build

Expand All @@ -22,40 +37,42 @@ jobs:
php:
- "7.4"
- "8.0"
- "8.1"
- "8.2"

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

- name: Install PHP
- name: Install PHP with extensions.
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
ini-values: date.timezone='UTC'
tools: composer:v2
coverage: pcov

- name: Determine composer cache directory on Linux
- name: Determine composer cache directory on Linux.
if: matrix.os == 'ubuntu-latest'
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV

- name: Determine composer cache directory on Windows
- name: Determine composer cache directory on Windows.
if: matrix.os == 'windows-latest'
run: echo "COMPOSER_CACHE_DIR=~\AppData\Local\Composer" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append

- name: Cache dependencies installed with composer
uses: actions/cache@v2
- name: Cache dependencies installed with composer.
uses: actions/cache@v3
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
php${{ matrix.php }}-composer-
- name: Update composer
- name: Update composer.
run: composer self-update

- name: Install dependencies with composer
- name: Install dependencies with composer.
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

- name: Run tests with phpunit
- name: Run tests with phpunit.
run: vendor/bin/phpunit --colors=always
41 changes: 29 additions & 12 deletions .github/workflows/static.yml
@@ -1,6 +1,21 @@
on:
- pull_request
- push
pull_request:
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'phpunit.xml.dist'

push:
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'phpunit.xml.dist'

name: static

Expand All @@ -18,37 +33,39 @@ jobs:
php:
- "7.4"
- "8.0"
- "8.1"
- "8.2"

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

- name: Install PHP
- name: Install PHP with extensions.
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
ini-values: memory_limit=-1
tools: composer:v2

- name: Determine composer cache directory
- name: Determine composer cache directory.
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV

- name: Cache dependencies installed with composer
uses: actions/cache@v2
- name: Cache dependencies installed with composer.
uses: actions/cache@v3
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
php${{ matrix.php }}-composer-
- name: Update composer
- name: Update composer.
run: composer self-update

- name: Install dependencies with composer
- name: Install dependencies with composer.
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

- name: PHPCS check
- name: PHPCS check.
run: vendor/bin/phpcs

- name: Psalm static analysis
- name: Psalm static analysis.
run: vendor/bin/psalm --no-progress
1 change: 1 addition & 0 deletions .gitignore
@@ -1,4 +1,5 @@
.phpunit.result.cache
composer.lock
phpunit.xml
psalm.xml
vendor
4 changes: 2 additions & 2 deletions composer.json
Expand Up @@ -24,8 +24,8 @@
},
"require-dev": {
"phpunit/phpunit": "^9.5",
"squizlabs/php_codesniffer": "^3.6",
"vimeo/psalm": "^4.9"
"squizlabs/php_codesniffer": "^3.7",
"vimeo/psalm": "^4.9|^5.2"
},
"provide": {
"psr/http-message-implementation": "1.0"
Expand Down
19 changes: 10 additions & 9 deletions phpunit.xml.dist
@@ -1,16 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/8.5/phpunit.xsd"
bootstrap="./vendor/autoload.php"
executionOrder="depends,defects"
bootstrap="vendor/autoload.php"
executionOrder="random"
beStrictAboutCoversAnnotation="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
convertWarningsToExceptions="true"
convertNoticesToExceptions="true"
convertErrorsToExceptions="true"
resolveDependencies="true"
stopOnFailure="false"
failOnWarning="true"
failOnRisky="true"
verbose="true"
colors="true"
>
Expand All @@ -24,9 +25,9 @@
</testsuite>
</testsuites>

<filter>
<whitelist>
<directory suffix=".php">./src/</directory>
</whitelist>
</filter>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
</include>
</coverage>
</phpunit>
6 changes: 5 additions & 1 deletion psalm.xml → psalm.xml.dist
@@ -1,12 +1,16 @@
<?xml version="1.0"?>
<psalm
errorLevel="1"
findUnusedPsalmSuppress="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"
>
<projectFiles>
<directory name="src" />
<directory name="src"/>
<ignoreFiles>
<directory name="vendor"/>
</ignoreFiles>
</projectFiles>

<issueHandlers>
Expand Down

0 comments on commit a573157

Please sign in to comment.