Skip to content

action for php8.2

action for php8.2 #27

Workflow file for this run

name: CI silverstripe-simple-pdf-preview
on:
pull_request: ~
push:
branches:
- master
jobs:
tests-php-7-4:
runs-on: ubuntu-latest
services:
mysql57:
image: mysql:5.7
env:
MYSQL_HOST: 127.0.0.1
MYSQL_USER: ss
MYSQL_PASSWORD: ss
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: SS_mysite
ports:
- 3357:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=10
steps:
- name: imagick-preparations
run: |
sudo apt-get install -y ghostscript
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
extensions: imagick
- name: Allow imagick pdf
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: composer install
run: |
composer install --prefer-dist --no-interaction --no-ansi --no-progress
- name: env file
run: |
# Add .env file and create artifacts directory
# Note: the wonky indentation is intentional so there is no space at the start of
# each newline in the .env file
cat << EOF > .env
SS_DATABASE_CLASS="MySQLPDODatabase"
SS_DATABASE_SERVER="127.0.0.1"
SS_DATABASE_PORT="3357"
SS_DATABASE_USERNAME="ss"
SS_DATABASE_PASSWORD="ss"
SS_DATABASE_NAME="SS_mysite"
EOF
# debug
echo ".env is"
cat .env
- name: PHPUnit
run: |
php vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
tests-php-8-0:
runs-on: ubuntu-latest
services:
mysql57:
image: mysql:5.7
env:
MYSQL_HOST: 127.0.0.1
MYSQL_USER: ss
MYSQL_PASSWORD: ss
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: SS_mysite
ports:
- 3357:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=10
steps:
- name: imagick-preparations
run: |
sudo apt-get install -y ghostscript
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
extensions: imagick
- name: Allow imagick pdf
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: composer install
run: |
composer install --prefer-dist --no-interaction --no-ansi --no-progress
- name: env file
run: |
# Add .env file and create artifacts directory
# Note: the wonky indentation is intentional so there is no space at the start of
# each newline in the .env file
cat << EOF > .env
SS_DATABASE_CLASS="MySQLPDODatabase"
SS_DATABASE_SERVER="127.0.0.1"
SS_DATABASE_PORT="3357"
SS_DATABASE_USERNAME="ss"
SS_DATABASE_PASSWORD="ss"
SS_DATABASE_NAME="SS_mysite"
EOF
# debug
echo ".env is"
cat .env
- name: PHPUnit
run: |
php vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
tests-php-8-2:
runs-on: ubuntu-latest
services:
mysql57:
image: mysql:8
env:
MYSQL_HOST: 127.0.0.1
MYSQL_USER: ss
MYSQL_PASSWORD: ss
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: SS_mysite
ports:
- 3357:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=10
steps:
- name: imagick-preparations
run: |
sudo apt-get install -y ghostscript
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: imagick
- name: Allow imagick pdf
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: composer install
run: |
composer install --prefer-dist --no-interaction --no-ansi --no-progress
- name: env file
run: |
# Add .env file and create artifacts directory
# Note: the wonky indentation is intentional so there is no space at the start of
# each newline in the .env file
cat << EOF > .env
SS_DATABASE_CLASS="MySQLPDODatabase"
SS_DATABASE_SERVER="127.0.0.1"
SS_DATABASE_PORT="3357"
SS_DATABASE_USERNAME="ss"
SS_DATABASE_PASSWORD="ss"
SS_DATABASE_NAME="SS_mysite"
EOF
# debug
echo ".env is"
cat .env
- name: PHPUnit
run: |
php vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover