Switch to dev-main of spatie/pixelmatch-php #181
This file contains 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
name: run-tests | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
max-parallel: 1 | |
matrix: | |
os: [ubuntu-latest] | |
php: [8.2, 8.3] | |
laravel: [10.*, 11.*] | |
stability: [prefer-lowest, prefer-stable] | |
include: | |
- laravel: 10.* | |
testbench: ^8.0 | |
- laravel: 11.* | |
testbench: ^9.0 | |
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo | |
coverage: pcov | |
ini-values: pcov.directory=src | |
- name: Fix Imagick Policy for PDFs | |
run: | | |
sudo sed -i 's/<policy domain="coder" rights="none" pattern="PDF" \/>/<policy domain="coder" rights="read|write" pattern="PDF" \/>/g' /etc/ImageMagick-6/policy.xml | |
- name: Install dependencies | |
run: | | |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update | |
composer update --${{ matrix.stability }} --prefer-dist --no-interaction | |
npm ci | |
# Secrets used by vendor/bin/testbench have to be declared inside testbench.yaml. env() can't be used. | |
- name: Setup Testbench | |
run: | | |
echo " | |
providers: | |
- Hammerstone\Sidecar\Providers\SidecarServiceProvider | |
- Wnx\SidecarBrowsershot\SidecarBrowsershotServiceProvider" >> testbench.yaml | |
# Deploy Lambda function before running the test suite. | |
- name: Deploy Lambda function | |
run: vendor/bin/testbench sidecar-browsershot:setup --no-interaction -vvv | |
env: | |
SIDECAR_ACCESS_KEY_ID: ${{secrets.SIDECAR_ACCESS_KEY_ID}} | |
SIDECAR_SECRET_ACCESS_KEY: ${{secrets.SIDECAR_SECRET_ACCESS_KEY}} | |
SIDECAR_REGION: ${{secrets.SIDECAR_REGION}} | |
SIDECAR_ARTIFACT_BUCKET_NAME: ${{secrets.SIDECAR_ARTIFACT_BUCKET_NAME}} | |
SIDECAR_EXECUTION_ROLE: ${{secrets.SIDECAR_EXECUTION_ROLE}} | |
- name: Execute tests | |
run: vendor/bin/pest --coverage --exclude-group=pdf-comparison | |
env: | |
SIDECAR_ACCESS_KEY_ID: ${{secrets.SIDECAR_ACCESS_KEY_ID}} | |
SIDECAR_SECRET_ACCESS_KEY: ${{secrets.SIDECAR_SECRET_ACCESS_KEY}} | |
SIDECAR_REGION: ${{secrets.SIDECAR_REGION}} | |
SIDECAR_ARTIFACT_BUCKET_NAME: ${{secrets.SIDECAR_ARTIFACT_BUCKET_NAME}} | |
SIDECAR_EXECUTION_ROLE: ${{secrets.SIDECAR_EXECUTION_ROLE}} |