Skip to content

Commit 0beab2a

Browse files
Support Laravel 8.
1 parent 6ce547d commit 0beab2a

4 files changed

Lines changed: 47 additions & 26 deletions

File tree

.github/workflows/main.yml

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,29 @@
1-
name: Unit tests
1+
name: Tests
22

33
on: [push]
44

55
jobs:
6-
run:
7-
runs-on: [ubuntu-latest]
6+
build:
7+
runs-on: ubuntu-latest
88
strategy:
9+
fail-fast: false
910
matrix:
10-
php-versions: ['7.1', '7.2', '7.3', '7.4']
11-
name: Tests - ${{ matrix.php-versions }}
12-
steps:
13-
- name: Checkout
14-
uses: actions/checkout@v1
15-
16-
- name: Setup PHP
17-
uses: shivammathur/setup-php@v1
18-
with:
19-
php-version: ${{ matrix.php-versions }}
20-
coverage: xdebug
11+
laravel: [5, 6, 7, 8]
12+
php: [7.1, 7.2, 7.3, 7.4, 8.0]
13+
exclude:
14+
- php: 7.1
15+
laravel: 6
16+
- php: 7.1
17+
laravel: 7
18+
- php: 7.1
19+
laravel: 8
20+
- php: 7.2
21+
laravel: 8
22+
- php: 8.0
23+
laravel: 5
2124

22-
- name: Install deps
23-
run: composer install
24-
25-
- name: Run tests
26-
run: vendor/bin/phpunit -c phpunit.xml --coverage-clover=coverage.xml
25+
steps:
26+
- uses: actions/checkout@v2
2727

28-
- name: Upload code coverage
29-
uses: codecov/codecov-action@v1
30-
with:
31-
token: ${{ secrets.CODECOV_TOKEN }}
28+
- name: test against Laravel ${{ matrix.laravel }} on PHP ${{ matrix.php }}
29+
run: docker build . --build-arg PHP_VERSION=${{ matrix.php }} --build-arg LARAVEL=${{ matrix.laravel }}

Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
ARG PHP_VERSION=8.0
2+
FROM php:$PHP_VERSION-cli-alpine
3+
4+
RUN apk add git zip unzip autoconf make g++
5+
6+
RUN if [ -z "${PHP_VERSION##7\.1*}" ]; then \
7+
pecl install xdebug-2.9.8 && docker-php-ext-enable xdebug; \
8+
else \
9+
pecl install xdebug && docker-php-ext-enable xdebug; \
10+
fi;
11+
12+
RUN curl -sS https://getcomposer.org/installer | php \
13+
&& mv composer.phar /usr/local/bin/composer
14+
15+
WORKDIR /package
16+
17+
COPY composer.json ./
18+
19+
RUN composer install
20+
21+
COPY . .
22+
23+
RUN vendor/bin/phpunit --configuration phpunit.xml

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
}
1111
],
1212
"require": {
13-
"php": ">=7.1",
14-
"symfony/process": "~3.4 || ~4.0",
13+
"php": ">=7.1|^8.0",
14+
"symfony/process": "~3.4 || ~4.0 || ~5.0",
1515
"guzzlehttp/guzzle": "^6.3"
1616
},
1717
"autoload": {

src/Chrome.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function __construct($binary = 'chrome-pdf', $processClass = null)
4848
*/
4949
public function createProcess($cmdline)
5050
{
51-
return new $this->{'processClass'}($cmdline);
51+
return new $this->{'processClass'}([$cmdline]);
5252
}
5353

5454
/**

0 commit comments

Comments
 (0)