テストが通るように修正 #190
Workflow file for this run
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: 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: | | |
sudo curl -sL https://github.com/docker/compose/releases/download/v2.14.2/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose | |
sudo chmod 755 /usr/local/bin/docker-compose | |
wp-env destory | |
wp-env start | |
- name: PHP Unit Test | |
run: npm run phpunit |