【2人目確認待ち】VK Compo を Composer から取得 #1905
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: | |
pull_request: | |
branches: | |
- master | |
- develop | |
jobs: | |
php_unit: | |
name: php unittest | |
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 dependencies | |
run: composer install | |
- name: Build | |
run: npm run build | |
- name: wp-env start | |
run: ./node_modules/@wordpress/env/bin/wp-env start | |
- name: install composer | |
run: ./node_modules/@wordpress/env/bin/wp-env run cli --env-cwd=wp-content/themes/lightning composer install | |
- name: Change file permission | |
run: | | |
umask | |
sudo chmod -R 777 ./ | |
sudo chmod -R 777 ~/wp-env | |
- name: php unit test root | |
run: ./node_modules/@wordpress/env/bin/wp-env run --env-cwd='wp-content/themes/lightning' tests-cli vendor/bin/phpunit -c phpunit.root.xml --testdox | |
- name: php unit test G2 | |
run: ./node_modules/@wordpress/env/bin/wp-env run --env-cwd='wp-content/themes/lightning' tests-cli vendor/bin/phpunit -c phpunit.g2.xml --testdox | |
- name: php unit test G3 | |
run: ./node_modules/@wordpress/env/bin/wp-env run --env-cwd='wp-content/themes/lightning' tests-cli vendor/bin/phpunit -c phpunit.g3.xml --testdox |