Skip to content

Limit pipeline to branches #86

Limit pipeline to branches

Limit pipeline to branches #86

Workflow file for this run

name: Pest Tests
on:
push:
branches:
- master
- v4
- release/*
- hotfix/*
pull_request:
branches:
- master
- v4
- release/*
- hotfix/*
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
php: [ 8.2, 8.3 ]
env:
DB_DATABASE: testbench
DB_USERNAME: root
DB_PASSWORD: root
name: PHP ${{ matrix.php }} - Pest Tests
services:
mysql:
image: 'mysql:8.0'
env:
MYSQL_ALLOW_EMPTY_PASSWORD: false
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: testbench
ports:
- 3306/tcp
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, xml, mbstring, zip, pdo, sqlite, bcmath, soap, intl, gd
coverage: none
- name: Create MySQL Database
run: |
sudo systemctl start mysql
mysql -u${{ env.DB_USERNAME }} -p${{ env.DB_PASSWORD }} -e 'CREATE DATABASE ${{ env.DB_DATABASE }};' --port ${{ job.services.mysql.ports['3306'] }}
- name: Setup problem matchers
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Install dependencies
run: composer update --prefer-stable --prefer-dist --no-interaction
- name: Execute tests
run: composer test