【2人目確認待ち】VK CSS Optimize の設定ファイル以外を削除 #1869
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 & Deploy develop | |
on: | |
push: | |
branches: | |
- develop | |
pull_request: | |
branches: | |
- develop | |
jobs: | |
php_unit: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php-versions: ['7.3', '7.4', '8.0', '8.1'] | |
wp-versions: ['6.3','6.2','6.1'] | |
name: PHP Unit test ${{ matrix.php-versions }} / WP ${{ matrix.wp-versions }} Test on ${{ matrix.operating-system }} | |
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 | |
# get the node version from the .node-version file | |
- name: Read .node-version | |
run: echo "##[set-output name=NODEVERSION;]$(cat .node-version)" | |
id: nodenv | |
# setup node based on the version from the .node-version file, fetched in the previous step | |
- name: Setup Node.js (.node-version) | |
uses: actions/setup-node@v1 | |
with: | |
node-version: "${{ steps.nodenv.outputs.NODEVERSION }}" | |
- name: Cache multiple paths | |
uses: actions/cache@v2 | |
with: | |
path: vendor | |
key: ${{ runner.os }}-php${{ matrix.php-versions }}-${{ hashFiles('**/composer.lock') }} | |
- name: Setup PHP ${{ matrix.php-versions }} | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-versions }} | |
- name: install npm scripts | |
run: npm install | |
- name: install Composer Package | |
run: composer install | |
- name: Install WP-CLI | |
run: | | |
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar | |
chmod +x wp-cli.phar | |
mv wp-cli.phar /usr/local/bin/wp | |
- name: Install several WordPress version by wp-env.override.json | |
run: WP_ENV_PHP_VERSION=${{ matrix.php-versions }} WP_ENV_CORE=WordPress/WordPress#${{ matrix.wp-versions }} npm run wp-env start --update | |
- name: Check WordPress Version | |
run: npm run wp-env run cli wp core version | |
# Build | |
- name: Build | |
run: npm run build | |
# PHPUnit | |
- name: PHP Unit Test | |
run: npm run phpunit | |
deployment: | |
runs-on: ubuntu-latest | |
needs: [php_unit] | |
steps: | |
- name: checkout | |
uses: actions/checkout@v2 | |
- name: Read .node-version | |
run: echo "##[set-output name=NODEVERSION;]$(cat .node-version)" | |
id: nodenv | |
- name: Setup Node.js (.node-version) | |
uses: actions/setup-node@v1 | |
with: | |
node-version: "${{ steps.nodenv.outputs.NODEVERSION }}" | |
- name: install npm scripts | |
run: npm install | |
- name: Install WP-CLI | |
run: | | |
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar | |
chmod +x wp-cli.phar | |
mv wp-cli.phar /usr/local/bin/wp | |
- name: Build and Dist | |
run: npm run dist | |
# Deploy test server | |
- name: Deploy to test server [ Deprecated ] | |
uses: burnett01/rsync-deployments@4.1 | |
with: | |
switches: -avzr | |
path: /dist/vk-blocks-pro/ | |
remote_path: /home/vs4/www/vk-block-test/wp-content/plugins/vk-blocks-pro/ | |
remote_host: ${{ secrets.DEPLOY_HOST_VS4 }} | |
remote_port: ${{ secrets.DEPLOY_PORT_VS4 }} | |
remote_user: ${{ secrets.DEPLOY_USER_VS4 }} | |
remote_key: ${{ secrets.DEPLOY_KEY_VS4 }} |