1
0
mirror of https://github.com/danog/dns.git synced 2024-11-26 20:14:51 +01:00

Add composer-require-checker and improve CI

This commit is contained in:
Niklas Keller 2021-12-14 21:03:21 +01:00
parent b0c8ccb6e4
commit aed733c230
5 changed files with 54 additions and 20 deletions

View File

@ -9,31 +9,18 @@ jobs:
strategy:
matrix:
include:
- operating-system: 'ubuntu-latest'
php-version: '7.0'
- operating-system: 'ubuntu-latest'
php-version: '7.1'
- operating-system: 'ubuntu-latest'
php-version: '7.2'
- operating-system: 'ubuntu-latest'
php-version: '7.3'
- operating-system: 'ubuntu-latest'
php-version: '7.4'
- operating-system: 'ubuntu-latest'
php-version: '8.0'
composer-flags: '--ignore-platform-req=php'
- operating-system: 'ubuntu-latest'
php-version: '8.1'
- operating-system: 'windows-latest'
php-version: '7.4'
php-version: '8.1'
job-description: 'on Windows'
- operating-system: 'macos-latest'
php-version: '7.4'
php-version: '8.1'
job-description: 'on macOS'
name: PHP ${{ matrix.php-version }} ${{ matrix.job-description }}
@ -53,6 +40,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: fiber-amphp/ext-fiber@master
- name: Get Composer cache directory
id: composer-cache
@ -86,3 +74,11 @@ jobs:
env:
PHP_CS_FIXER_IGNORE_ENV: 1
run: vendor/bin/php-cs-fixer --diff --dry-run -v fix
- name: Install composer-require-checker
run: php -r 'file_put_contents("composer-require-checker.phar", file_get_contents("https://github.com/maglnet/ComposerRequireChecker/releases/download/3.7.0/composer-require-checker.phar"));'
if: runner.os != 'Windows' && matrix.composer-require-checker-version != 'none'
- name: Run composer-require-checker
run: php composer-require-checker.phar check composer.json --config-file $PWD/composer-require-check.json
if: runner.os != 'Windows' && matrix.composer-require-checker-version != 'none'%

1
.gitignore vendored
View File

@ -5,3 +5,4 @@ vendor
.php_cs.cache
.phpunit.result.cache
coverage
composer-require-checker.phar

View File

@ -0,0 +1,35 @@
{
"symbol-whitelist": [
"null",
"true",
"false",
"static",
"self",
"parent",
"array",
"string",
"int",
"float",
"bool",
"iterable",
"callable",
"mixed",
"void",
"object",
"createDefaultResolver",
"normalizeName",
"resolver",
"idn_to_ascii",
"INTL_IDNA_VARIANT_UTS46"
],
"php-core-extensions": [
"Core",
"date",
"pcre",
"Phar",
"Reflection",
"SPL",
"standard",
"hash"
]
}

View File

@ -44,7 +44,8 @@
"amphp/cache": "^2",
"amphp/parser": "^1",
"amphp/windows-registry": "^1",
"daverandom/libdns": "^2.0.2"
"daverandom/libdns": "^2.0.2",
"revolt/event-loop": "^0.1.1"
},
"require-dev": {
"amphp/phpunit-util": "^3",

View File

@ -47,7 +47,8 @@ abstract class Socket
$this->lastActivity = \time();
}
private function fetch(): void {
private function fetch(): void
{
EventLoop::queue(function (): void {
try {
$this->handleResolution(null, $this->receive());