Repository navigation
Leave an active button with an empty value blank instead of showing its field name (#459) #980
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://help.github.com/en/categories/automating-your-workflow-with-github-actions | |
| name: "Snapshot Tests" | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - "master" | |
| - "development" | |
| - "test" | |
| - "gravitypdf" | |
| jobs: | |
| tests: | |
| name: "Tests" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: "Checkout" | |
| uses: "actions/checkout@v7" | |
| - name: Update sources and install ghostscript | |
| uses: awalsh128/cache-apt-pkgs-action@v1 | |
| with: | |
| packages: ghostscript | |
| version: 1.0 | |
| refresh: true | |
| - name: "Install PHP" | |
| uses: "shivammathur/setup-php@v2" | |
| with: | |
| coverage: "none" | |
| php-version: "8.5" | |
| extensions: "mbstring, gd, bcmath, bz2, imagick, fileinfo" | |
| tools: composer:v2 | |
| ini-values: error_reporting=-1 | |
| - name: "Let Imagick read PDFs" | |
| run: | | |
| # Older policies forbid the PDF coder. Snapshots only rasterise when they differ, so read one now to fail early | |
| sudo sed -i 's/rights="none" pattern="PDF"/rights="read|write" pattern="PDF"/' /etc/ImageMagick-*/policy.xml | |
| php -r '$i = new Imagick(); $i->setResolution(120, 120); $i->readImage("tests/data/snapshots/fixed-position-html.pdf"); printf("%s read %d page of %dx%d px\n", Imagick::getVersion()["versionString"], $i->getNumberImages(), $i->getImageWidth(), $i->getImageHeight());' | |
| - name: "Locate Composer cache" | |
| id: composer-cache | |
| shell: bash | |
| run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT" | |
| - name: "Cache Composer downloads" | |
| uses: "actions/cache@v6" | |
| with: | |
| path: "${{ steps.composer-cache.outputs.dir }}" | |
| key: "composer-${{ runner.os }}-php8.5-${{ hashFiles('composer.json') }}" | |
| restore-keys: "composer-${{ runner.os }}-php8.5-" | |
| - name: "Install dependencies" | |
| run: "composer install --no-interaction --no-progress" | |
| - name: "Snapshot Tests" | |
| run: composer test -- --group=snapshot | |
| - uses: actions/upload-artifact@v7 | |
| if: ${{ failure() }} | |
| with: | |
| name: "phpunit-artifact" | |
| path: tmp/artifacts/ | |
| if-no-files-found: ignore |