Skip to content

Commit

Permalink
Merge pull request #117 from dantleech/updated
Browse files Browse the repository at this point in the history
General Update
  • Loading branch information
dantleech committed Jan 28, 2021
2 parents 5ffd9bc + 26290a1 commit 08cb6ac
Show file tree
Hide file tree
Showing 22 changed files with 562 additions and 58 deletions.
115 changes: 115 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
name: "CI"

on:
pull_request:
push:
branches:
- 'master'

env:
fail-fast: true
TZ: "Europe/Paris"

jobs:
php-cs-fixer:
name: "PHP-CS-Fixer (${{ matrix.php-version }})"

runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- '7.3'

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

-
name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
php-version: "${{ matrix.php-version }}"
tools: composer:v2

-
name: "Composer install"
uses: "ramsey/composer-install@v1"
with:
composer-options: "--no-scripts"

-
name: "Run friendsofphp/php-cs-fixer"
run: "vendor/bin/php-cs-fixer fix --dry-run --diff --verbose --allow-risky=yes"

phpstan:
name: "PHPStan (${{ matrix.php-version }})"

runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- '7.3'

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

-
name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
php-version: "${{ matrix.php-version }}"
tools: composer:v2

-
name: "Composer install"
uses: "ramsey/composer-install@v1"
with:
composer-options: "--no-scripts"

-
name: "Run PHPStan"
run: "vendor/bin/phpstan analyse"
phpunit:
name: "PHPUnit (${{ matrix.php-version }})"

runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- '7.3'
- '7.4'
- '8.0'

steps:
-
name: "Checkout code"
uses: "actions/checkout@v2"
-
name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
php-version: "${{ matrix.php-version }}"
tools: composer:v2
-
name: "Remove BOX"
run: "composer remove humbug/box --no-update --dev"
-
name: "Composer install"
uses: "ramsey/composer-install@v1"
with:
composer-options: "--no-scripts"
-
name: "Run PHPUnit"
run: "vendor/bin/phpunit"
38 changes: 38 additions & 0 deletions .github/workflows/release-phar.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
on:
release:
types:
- created

name: Append phpbench.phar to release

jobs:
build:
name: Compile and upload Phar
runs-on: ubuntu-18.04
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set PHP 7.3
uses: shivammathur/setup-php@v2
with:
php-version: '7.3'

- name: Compile phpbench.phar
run: |
composer install
wget https://github.com/box-project/box/releases/download/3.9.1/box.phar
php box.phar compile -c box.json.gh-release
- name: Check existence of compiled .phar
run: test -e fink.phar && exit 0 || exit 10

- name: Upload to Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./phpbench.phar
asset_name: phpbench.phar
asset_content_type: application/octet-stream
34 changes: 0 additions & 34 deletions .travis.yml

This file was deleted.

7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": "^7.2",
"php": "^7.3||^8.0",
"amphp/dns": "^v1.2.2",
"amphp/file": "^1",
"amphp/http-client": "^4.1.0",
Expand All @@ -28,8 +28,9 @@
"friendsofphp/php-cs-fixer": "^2.14",
"humbug/box": "^3.4",
"phpactor/test-utils": "^1.0",
"phpstan/phpstan": "^0.10.8",
"phpunit/phpunit": "^7.5"
"phpspec/prophecy-phpunit": "^2.0",
"phpstan/phpstan": "^0.12.0",
"phpunit/phpunit": "^9.0"
},
"autoload": {
"psr-4": {
Expand Down
4 changes: 4 additions & 0 deletions lib/Model/Crawler.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ public function crawl(Url $documentUrl, UrlQueue $queue, ReportBuilder $report):

$body = yield $response->getBody()->buffer();

if (!$body) {
return;
}

$this->enqueueLinks($this->loadXpath($body), $ultimateUrl, $report, $queue);
}

Expand Down

0 comments on commit 08cb6ac

Please sign in to comment.