Skip to content

Merge pull request #64 from vektor-inc/update/add-php-require #69

Merge pull request #64 from vektor-inc/update/add-php-require

Merge pull request #64 from vektor-inc/update/add-php-require #69

Workflow file for this run

name: PHP Unit Test
on:
push:
branches:
- master
- develop
pull_request:
branches:
- master
- develop
- ^feature/.+
jobs:
php_unit:
name: php unit test
runs-on: ubuntu-latest
strategy:
matrix:
php: [7.4, 8.0, 8.1]
services:
mysql:
image: mysql:5.7
ports:
- 3306
env:
MYSQL_ROOT_PASSWORD: wordpress
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 20.x
- name: Cache multiple paths
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
- name: Install NPM Scripts
run: npm install
- name: Install Composer Packages
run: composer install
- name: Build
run: npm run build
- name: Start Environment
run: npx wp-env start
- name: PHP Unit Test
run: npm run phpunit