From 73d8186d6bb0fa3cb0595073a2be4b2f1e0be57e Mon Sep 17 00:00:00 2001 From: William Desportes Date: Wed, 6 Sep 2023 15:00:03 +0200 Subject: [PATCH] Bump actions/checkout and add PHP 8.3 (#642) * Bump actions/checkout and add PHP 8.3 * Update the composer json tests * Remove PHP 5.3 and 5.4 from the matrix * add permission entry Restrict GitHub actions access --------- Co-authored-by: Nicola Asuni --- .github/workflows/lint-docs.yml | 2 +- .github/workflows/tests.yml | 21 +++++++++++---------- tests/composer.json | 14 ++------------ 3 files changed, 14 insertions(+), 23 deletions(-) diff --git a/.github/workflows/lint-docs.yml b/.github/workflows/lint-docs.yml index 4830f268..543d82fc 100644 --- a/.github/workflows/lint-docs.yml +++ b/.github/workflows/lint-docs.yml @@ -12,7 +12,7 @@ jobs: lint-docs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: lint php documentation uses: sudo-bot/action-doctum@dev with: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ecfd73a5..e02383f4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,5 +1,8 @@ name: Run tests +permissions: + contents: read + on: push: branches: @@ -16,7 +19,7 @@ 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"] + 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", "8.3"] os: [macos-latest, windows-latest] experimental: [false] php-extensions: ["bcmath, imagick, gd"] @@ -26,14 +29,12 @@ jobs: # 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 } + + # Add more specific tests include: - - { 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 @@ -50,11 +51,12 @@ jobs: - { 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: '8.3', 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@v3 + - uses: actions/checkout@v4 - name: Install pdfinfo, pdftopng or pdftoppm uses: ConorMacBride/install-package@v1 with: @@ -86,9 +88,9 @@ jobs: path: ~/.composer/cache/ key: composer-cache - name: Install dependencies - run: composer install --no-interaction + run: composer update --no-interaction - name: Install test dependencies - run: cd ./tests && composer install --no-interaction && cd ../ + run: cd ./tests && composer update --no-interaction && cd ../ - name: Run shell-based test suite if: runner.os == 'Linux' run: ./tests/launch.sh @@ -118,12 +120,11 @@ jobs: name: Static Analysis runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Use php 8.0 uses: shivammathur/setup-php@v2 with: php-version: 8.0 - tools: composer:v2 - name: Cache module uses: actions/cache@v3 with: diff --git a/tests/composer.json b/tests/composer.json index 065fcbeb..3edd4a90 100644 --- a/tests/composer.json +++ b/tests/composer.json @@ -2,13 +2,8 @@ "name": "tecnickcom/tcpdf-tests", "type": "metapackage", "description": "Dependencies for the test suite", - "keywords": [ - "PDF", - "tcpdf", - "test" - ], "homepage": "http://www.tcpdf.org/", - "license": "LGPL-3.0-only", + "license": "LGPL-3.0-or-later", "authors": [ { "name": "Philippe Jausions", @@ -18,7 +13,7 @@ ], "require": { "PHP": ">=5.3.0", - "cs278/mktemp": "*" + "cs278/mktemp": "^1.2.0" }, "suggest": { "rosell-dk/locate-binaries": "Allows to detect executables such as pdfinfo" @@ -27,10 +22,5 @@ "psr-4": { "Tecnickcom\\TCPDF\\Tests\\": "src/" } - }, - "archive": { - "exclude": [ - "/examples" - ] } }