Skip to content

Commit

Permalink
Add ability to run tests on various operating systems (#566)
Browse files Browse the repository at this point in the history
Co-authored-by: Philippe Jausions <Philippe.Jausions@11abacus.com>
Co-authored-by: Nicola Asuni <nicolaasuni@users.noreply.github.com>
  • Loading branch information
3 people committed Dec 17, 2022
1 parent ef356f0 commit 8872a9c
Show file tree
Hide file tree
Showing 97 changed files with 2,311 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
lint-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: lint php documentation
uses: sudo-bot/action-doctum@dev
with:
Expand Down
94 changes: 76 additions & 18 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,58 +15,116 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: ["5.3", "5.4", "5.5", "5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2"]
os: [macos-latest, windows-latest]
experimental: [false]
coverage-extension: [pcov]
php-version: ["7.1", "7.2", "7.3", "7.4", "8.0", "8.1"]
os: [ubuntu-latest]
php-extensions: ["bcmath, imagick, gd"]
coverage-extension: ["none"]
exclude:
# For now, we do not know how to run workflow on Windows
# with imagick PHP extension for PHP 5.3 - 5.6
- { php-version: '5.3', os: windows-latest }
- { php-version: '5.4', os: windows-latest }
- { php-version: '5.5', os: windows-latest }
- { php-version: '5.6', os: windows-latest }
# Somehow some tests fail under Windows and PHP 7.0,
# so we disable that run for now
- { php-version: '7.0', os: windows-latest }
include:
- { php-version: '5.3', experimental: false, os: ubuntu-latest, coverage-extension: 'xdebug' }
- { php-version: '5.4', experimental: false, os: ubuntu-latest, coverage-extension: 'xdebug' }
- { php-version: '5.5', experimental: false, os: ubuntu-latest, coverage-extension: 'xdebug' }
- { php-version: '5.6', experimental: false, os: ubuntu-latest, coverage-extension: 'xdebug' }
- { php-version: 'nightly', experimental: true, os: ubuntu-latest, coverage-extension: 'pcov' }
- { php-version: '5.3', os: windows-latest, experimental: false, php-extensions: 'bcmath, gd', coverage-extension: 'none' }
- { php-version: '5.4', os: windows-latest, experimental: false, php-extensions: 'bcmath, gd', coverage-extension: 'none' }
- { php-version: '5.5', os: windows-latest, experimental: false, php-extensions: 'bcmath, gd', coverage-extension: 'none' }
- { php-version: '5.6', os: windows-latest, experimental: false, php-extensions: 'bcmath, gd', coverage-extension: 'none' }
# Specify coverage extension for Ubuntu runs
- { php-version: '5.3', os: ubuntu-latest, experimental: false, php-extensions: 'bcmath, imagick, gd', coverage-extension: 'xdebug' }
- { php-version: '5.4', os: ubuntu-latest, experimental: false, php-extensions: 'bcmath, imagick, gd', coverage-extension: 'xdebug' }
- { php-version: '5.5', os: ubuntu-latest, experimental: false, php-extensions: 'bcmath, imagick, gd', coverage-extension: 'xdebug' }
- { php-version: '5.6', os: ubuntu-latest, experimental: false, php-extensions: 'bcmath, imagick, gd', coverage-extension: 'xdebug' }
- { php-version: '7.0', os: ubuntu-latest, experimental: false, php-extensions: 'bcmath, imagick, gd', coverage-extension: 'xdebug' }
# pcov is available from PHP 7.1
- { php-version: '7.1', os: ubuntu-latest, experimental: false, php-extensions: 'bcmath, imagick, gd', coverage-extension: 'pcov' }
- { php-version: '7.2', os: ubuntu-latest, experimental: false, php-extensions: 'bcmath, imagick, gd', coverage-extension: 'pcov' }
- { php-version: '7.3', os: ubuntu-latest, experimental: false, php-extensions: 'bcmath, imagick, gd', coverage-extension: 'pcov' }
- { php-version: '7.4', os: ubuntu-latest, experimental: false, php-extensions: 'bcmath, imagick, gd', coverage-extension: 'pcov' }
- { php-version: '8.0', os: ubuntu-latest, experimental: false, php-extensions: 'bcmath, imagick, gd', coverage-extension: 'pcov' }
- { php-version: '8.1', os: ubuntu-latest, experimental: false, php-extensions: 'bcmath, imagick, gd', coverage-extension: 'pcov' }
- { php-version: '8.2', os: ubuntu-latest, experimental: false, php-extensions: 'bcmath, imagick, gd', coverage-extension: 'pcov' }
- { php-version: 'nightly', os: ubuntu-latest, experimental: true, php-extensions: 'bcmath, imagick, gd', coverage-extension: 'pcov' }
env:
PDFINFO_BINARY: ${{ (matrix.os == 'ubuntu-latest') && '/usr/bin/pdfinfo' || ((matrix.os == 'macos-latest') && '/usr/local/bin/pdfinfo' || 'C:\ProgramData\Chocolatey\bin\pdfinfo.exe') }}
steps:
- uses: actions/checkout@v2
- name: Install pdfinfo
run: sudo apt-get install -y poppler-utils
- uses: actions/checkout@v3
- name: Install pdfinfo, pdftopng or pdftoppm
uses: ConorMacBride/install-package@v1
with:
apt: poppler-utils
brew: poppler
choco: xpdf-utils
- name: Install magick
if: runner.os == 'Linux'
uses: mfinelli/setup-imagemagick@v2
- name: Install magick
uses: ConorMacBride/install-package@v1
with:
brew: imagemagick@6
choco: imagemagick
- name: Use php ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: ${{ matrix.coverage-extension }}
extensions: bcmath, imagick, gd
ini-values: display_errors=on, error_reporting=-1
extensions: ${{ matrix.php-extensions }}
ini-values: display_errors=on, display_startup_errors=on, error_reporting=-1
- name: List php modules
run: php -m
- name: List php modules using "no php ini" mode
run: php -m -n
- name: Cache module
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.composer/cache/
key: composer-cache
- name: Install dependencies
run: composer install --no-interaction
- name: Run php tests
- name: Install test dependencies
run: cd ./tests && composer install --no-interaction && cd ../
- name: Run shell-based test suite
if: runner.os == 'Linux'
run: ./tests/launch.sh
- name: Send coverage
uses: codecov/codecov-action@v1
if: matrix.coverage-extension != 'none'
uses: codecov/codecov-action@v3
with:
flags: php-${{ matrix.php-version }}-${{ matrix.os }}
name: php-${{ matrix.php-version }}-${{ matrix.os }}
- name: Create output folder
run: mkdir ./tests/output
- name: Run PHP-based test suite
run: php ./tests/launch.php --output-dir ./tests/output
# The PHP_BINARY environment variable is only available since PHP 5.4
env:
PHP_BINARY: ${{ (matrix.os == 'ubuntu-latest') && '/usr/bin/php' || ((matrix.os == 'macos-latest') && '/usr/local/bin/php' || 'C:\tools\php\php.exe') }}
# For debugging issues
- name: Archive test results
if: failure()
uses: actions/upload-artifact@v3
with:
name: test-run-output-${{ matrix.php-version }}-${{ matrix.os }}
retention-days: 1
path: ./tests/output

analyse-php:
name: Static Analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Use php 8.0
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
tools: composer:v2
- name: Cache module
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.composer/cache/
key: composer-cache
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
*.bak
/vendor/
/composer.lock
/composer.phar
4 changes: 4 additions & 0 deletions examples/barcodes/example_1d_html.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
* @package com.tecnick.tcpdf
* @author Nicola Asuni
* @version 1.0.000
* @group barcode
* @group 1d
* @group html
* @group comparable
*/

// include 1D barcode class (search for installation path)
Expand Down
3 changes: 3 additions & 0 deletions examples/barcodes/example_1d_png.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
* @package com.tecnick.tcpdf
* @author Nicola Asuni
* @version 1.0.000
* @group barcode
* @group 1d
* @group png
*/

// include 1D barcode class (search for installation path)
Expand Down
4 changes: 4 additions & 0 deletions examples/barcodes/example_1d_svg.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
* @package com.tecnick.tcpdf
* @author Nicola Asuni
* @version 1.0.000
* @group barcode
* @group 1d
* @group svg
* @group comparable
*/

// include 1D barcode class (search for installation path)
Expand Down
4 changes: 4 additions & 0 deletions examples/barcodes/example_1d_svgi.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
* @package com.tecnick.tcpdf
* @author Nicola Asuni
* @version 1.0.000
* @group barcode
* @group 1d
* @group svg
* @group comparable
*/

// include 1D barcode class (search for installation path)
Expand Down
4 changes: 4 additions & 0 deletions examples/barcodes/example_2d_datamatrix_html.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
* @package com.tecnick.tcpdf
* @author Nicola Asuni
* @version 1.0.009
* @group barcode
* @group datamatrix
* @group html
* @group comparable
*/

// include 2D barcode class (search for installation path)
Expand Down
3 changes: 3 additions & 0 deletions examples/barcodes/example_2d_datamatrix_png.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
* @package com.tecnick.tcpdf
* @author Nicola Asuni
* @version 1.0.009
* @group barcode
* @group datamatrix
* @group png
*/

// include 2D barcode class (search for installation path)
Expand Down
4 changes: 4 additions & 0 deletions examples/barcodes/example_2d_datamatrix_svg.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
* @package com.tecnick.tcpdf
* @author Nicola Asuni
* @version 1.0.009
* @group barcode
* @group datamatrix
* @group svg
* @group comparable
*/

// include 2D barcode class (search for installation path)
Expand Down
4 changes: 4 additions & 0 deletions examples/barcodes/example_2d_datamatrix_svgi.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
* @package com.tecnick.tcpdf
* @author Nicola Asuni
* @version 1.0.009
* @group barcode
* @group datamatrix
* @group svg
* @group comparable
*/

// include 2D barcode class (search for installation path)
Expand Down
4 changes: 4 additions & 0 deletions examples/barcodes/example_2d_pdf417_html.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
* @package com.tecnick.tcpdf
* @author Nicola Asuni
* @version 1.0.009
* @group barcode
* @group pdf417
* @group html
* @group comparable
*/

// include 2D barcode class (search for installation path)
Expand Down
3 changes: 3 additions & 0 deletions examples/barcodes/example_2d_pdf417_png.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
* @package com.tecnick.tcpdf
* @author Nicola Asuni
* @version 1.0.009
* @group barcode
* @group pdf417
* @group png
*/

// include 2D barcode class (search for installation path)
Expand Down
4 changes: 4 additions & 0 deletions examples/barcodes/example_2d_pdf417_svg.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
* @package com.tecnick.tcpdf
* @author Nicola Asuni
* @version 1.0.009
* @group barcode
* @group pdf417
* @group svg
* @group comparable
*/

// include 2D barcode class (search for installation path)
Expand Down
4 changes: 4 additions & 0 deletions examples/barcodes/example_2d_pdf417_svgi.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
* @package com.tecnick.tcpdf
* @author Nicola Asuni
* @version 1.0.009
* @group barcode
* @group pdf417
* @group svg
* @group comparable
*/

// include 2D barcode class (search for installation path)
Expand Down
3 changes: 3 additions & 0 deletions examples/barcodes/example_2d_qrcode_html.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
* @package com.tecnick.tcpdf
* @author Nicola Asuni
* @version 1.0.009
* @group barcode
* @group qrcode
* @group html
*/

// include 2D barcode class (search for installation path)
Expand Down
3 changes: 3 additions & 0 deletions examples/barcodes/example_2d_qrcode_png.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
* @package com.tecnick.tcpdf
* @author Nicola Asuni
* @version 1.0.009
* @group barcode
* @group qrcode
* @group png
*/

// include 2D barcode class (search for installation path)
Expand Down
3 changes: 3 additions & 0 deletions examples/barcodes/example_2d_qrcode_svg.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
* @package com.tecnick.tcpdf
* @author Nicola Asuni
* @version 1.0.009
* @group barcode
* @group qrcode
* @group svg
*/

// include 2D barcode class (search for installation path)
Expand Down
3 changes: 3 additions & 0 deletions examples/barcodes/example_2d_qrcode_svgi.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
* @package com.tecnick.tcpdf
* @author Nicola Asuni
* @version 1.0.009
* @group barcode
* @group qrcode
* @group svg
*/

// include 2D barcode class (search for installation path)
Expand Down
4 changes: 4 additions & 0 deletions examples/example_001.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
* @abstract TCPDF - Example: Default Header and Footer
* @author Nicola Asuni
* @since 2008-03-04
* @group header
* @group footer
* @group page
* @group pdf
*/

// Include the main TCPDF library (search for installation path).
Expand Down
4 changes: 4 additions & 0 deletions examples/example_002.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
* @abstract TCPDF - Example: Removing Header and Footer
* @author Nicola Asuni
* @since 2008-03-04
* @group header
* @group footer
* @group page
* @group pdf
*/

// Include the main TCPDF library (search for installation path).
Expand Down
4 changes: 4 additions & 0 deletions examples/example_003.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
* @abstract TCPDF - Example: Custom Header and Footer
* @author Nicola Asuni
* @since 2008-03-04
* @group header
* @group footer
* @group page
* @group pdf
*/

// Include the main TCPDF library (search for installation path).
Expand Down
2 changes: 2 additions & 0 deletions examples/example_004.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
* @abstract TCPDF - Example: Cell stretching
* @author Nicola Asuni
* @since 2008-03-04
* @group cell
* @group pdf
*/

// Include the main TCPDF library (search for installation path).
Expand Down
2 changes: 2 additions & 0 deletions examples/example_005.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
* @abstract TCPDF - Example: Multicell
* @author Nicola Asuni
* @since 2008-03-04
* @group cell
* @group pdf
*/

// Include the main TCPDF library (search for installation path).
Expand Down
3 changes: 3 additions & 0 deletions examples/example_006.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
* @abstract TCPDF - Example: WriteHTML and RTL support
* @author Nicola Asuni
* @since 2008-03-04
* @group html
* @group rtl
* @group pdf
*/

// Include the main TCPDF library (search for installation path).
Expand Down
4 changes: 4 additions & 0 deletions examples/example_007.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
* @abstract TCPDF - Example: Two independent columns with WriteHTMLCell()
* @author Nicola Asuni
* @since 2008-03-04
* @group column
* @group cell
* @group html
* @group pdf
*/

// Include the main TCPDF library (search for installation path).
Expand Down
Loading

0 comments on commit 8872a9c

Please sign in to comment.