Skip to content

テストが通るように修正 #196

テストが通るように修正

テストが通るように修正 #196

Workflow file for this run

name: PHP Unit Test
on:
push:
branches:
- master
- develop
pull_request:
branches:
- master
- develop
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
- name: Setup Node.js (.node-version)
uses: actions/setup-node@v2
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 Node Scripts
run: npm install
- name: Install Composer Packages
run: composer install
- name: Build
run: npm run build
- name: Install Lightning Theme
run: |
curl -sL https://downloads.wordpress.org/theme/lightning.zip -o theme.zip
mkdir temp
unzip theme.zip -d temp/themes
rm -f theme.zip
- name: Install Lightning G3 Pro Unit
run: |
curl -sL "${{ secrets.G3_PRO_UNIT_URL }}" -o plugin.zip
unzip plugin.zip -d temp/plugins
rm -f plugin.zip
- name: Install @wordpress/env
run: npm install -g @wordpress/env
- name: Run @wordpress/env
run: |
wp-env destory
wp-env start
- name: PHP Unit Test
run: npm run phpunit