Skip to content

Commit 4cad358

Browse files
authored
Merge pull request #47 from limenet/master
Actions and Version Requirements
2 parents 3ec84c7 + 4ca7dae commit 4cad358

11 files changed

Lines changed: 2522 additions & 79 deletions

File tree

.github/workflows/js.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Node.js Checks
2+
3+
on: [ push, pull_request ]
4+
5+
permissions:
6+
contents: read
7+
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
node-version: [14, latest, lts/*]
17+
18+
steps:
19+
- uses: actions/checkout@v3
20+
- name: Use Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v3
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
cache: 'npm'
25+
- run: npm ci
26+
- run: npm test

.github/workflows/php.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: PHP Checks
2+
3+
on: [ push, pull_request ]
4+
5+
permissions:
6+
contents: read
7+
8+
jobs:
9+
10+
lint:
11+
12+
name: PHP ${{ matrix.php-versions }} on ${{ matrix.operating-system }}
13+
runs-on: ${{ matrix.operating-system }}
14+
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
operating-system: [ ubuntu-latest ]
19+
php-versions: [ '8.0', '8.1' ]
20+
21+
steps:
22+
- uses: actions/checkout@v3
23+
24+
- name: Setup PHP, with composer and extensions
25+
uses: shivammathur/setup-php@v2
26+
with:
27+
php-version: ${{ matrix.php-versions }}
28+
29+
- name: Cache composer dependencies
30+
uses: actions/cache@v3
31+
with:
32+
path: vendor
33+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
34+
restore-keys: |
35+
${{ runner.os }}-php-
36+
37+
- name: Install dependencies
38+
run: composer install --prefer-dist --no-progress
39+
40+
- name: PHPUnit
41+
run: composer run test
42+
43+
44+
- name: Publish code coverage
45+
uses: paambaati/codeclimate-action@v3.0.0
46+
env:
47+
CC_TEST_REPORTER_ID: 9f50abd103970276888567b08e665c8cedb039ee0a529ef768df269028f9d879

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,4 @@ test.php
88
node-output.pdf
99
php-output.pdf
1010
composer.lock
11-
package-lock.json
12-
.phpunit.result.cache
11+
.phpunit.result.cache

.travis.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ RUN apt-get update && apt-get install -y \
88
libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 lsb-release \
99
wget xdg-utils
1010

11-
RUN curl -fsSL https://deb.nodesource.com/setup_current.x | bash - && \
11+
RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \
1212
apt-get install -y nodejs
1313

1414
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
1515

1616
COPY . /usr/src/app
1717
WORKDIR /usr/src/app
1818

19-
CMD ["php", "-a"]
19+
CMD ["php", "-a"]

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
A PHP library for converting HTML to PDF using Google Chrome.
44

5-
[![Build Status](https://travis-ci.org/spiritix/php-chrome-html2pdf.svg?branch=master)](https://travis-ci.org/spiritix/php-chrome-html2pdf)
5+
[![PHP Checks](https://github.com/spiritix/php-chrome-html2pdf/actions/workflows/php.yml/badge.svg)](https://github.com/spiritix/php-chrome-html2pdf/actions/workflows/php.yml)
6+
[![Node.js Checks](https://github.com/spiritix/php-chrome-html2pdf/actions/workflows/js.yml/badge.svg)](https://github.com/spiritix/php-chrome-html2pdf/actions/workflows/js.yml)
67
[![Code Climate](https://codeclimate.com/github/spiritix/php-chrome-html2pdf/badges/gpa.svg)](https://codeclimate.com/github/spiritix/php-chrome-html2pdf)
78
[![Total Downloads](https://poser.pugx.org/spiritix/php-chrome-html2pdf/d/total.svg)](https://packagist.org/packages/spiritix/php-chrome-html2pdf)
89
[![Latest Stable Version](https://poser.pugx.org/spiritix/php-chrome-html2pdf/v/stable.svg)](https://packagist.org/packages/spiritix/php-chrome-html2pdf)
@@ -24,7 +25,7 @@ and all the other fancy stuff people use these days.
2425
## Requirements
2526

2627
- PHP 8.0+ with enabled program execution functions (proc_open) and 'fopen wrappers'
27-
- Node.js 18.0.0+ (for older Node.js versions use see [changelog](https://github.com/spiritix/php-chrome-html2pdf/blob/master/CHANGELOG.md))
28+
- Node.js 14.1.0+ (for older Node.js versions use see [changelog](https://github.com/spiritix/php-chrome-html2pdf/blob/master/CHANGELOG.md))
2829
- A few [OS specific dependencies](https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#chrome-headless-doesnt-launch-on-unix)
2930

3031
## Installation

composer.json

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,28 @@
33
"type": "library",
44
"description": "A PHP library for converting HTML to PDF using Google Chrome",
55
"license": "MIT",
6-
"keywords": ["php","html","pdf","Html2Pdf","html2pdf","chrome","headless","puppeteer"],
6+
"keywords": [
7+
"php",
8+
"html",
9+
"pdf",
10+
"Html2Pdf",
11+
"html2pdf",
12+
"chrome",
13+
"headless",
14+
"puppeteer"
15+
],
716
"authors": [
817
{
918
"name": "Matthias Isler",
1019
"email": "mi@matthias-isler.ch"
1120
}
1221
],
1322
"require": {
14-
"php": ">=8.0",
15-
"eloquent/composer-npm-bridge": "^5"
23+
"php": "^8.0",
24+
"eloquent/composer-npm-bridge": "^5.0"
1625
},
1726
"require-dev": {
18-
"phpunit/phpunit": "~9.0"
27+
"phpunit/phpunit": "^9.0"
1928
},
2029
"autoload": {
2130
"psr-4": {
@@ -37,5 +46,8 @@
3746
"allow-plugins": {
3847
"eloquent/composer-npm-bridge": true
3948
}
49+
},
50+
"scripts": {
51+
"test": "./vendor/bin/phpunit"
4052
}
4153
}

lib/Converter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class Converter
4545
{
4646
return puppeteer.launch({
4747
ignoreHTTPSErrors: true,
48-
args: ['--no-sandbox', '--disable-web-security']
48+
args: ['--no-sandbox', '--disable-web-security', '--font-render-hinting=none']
4949
});
5050
}
5151

0 commit comments

Comments
 (0)