Skip to content

Commit

Permalink
Merge pull request #179 from vektor-inc/develop
Browse files Browse the repository at this point in the history
[ Change version ] 1.27.0
  • Loading branch information
kurudrive authored May 4, 2023
2 parents 8bd70c0 + 390f630 commit baef391
Show file tree
Hide file tree
Showing 32 changed files with 20,490 additions and 13,648 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/php_unit_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: PHP Unit Test

on:
pull_request:
branches:
- master
- develop
- ^feature/.+
jobs:
php_unit:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['7.4', '8.0', '8.1']
wp-versions: ['6.1.1', '6.0.3', '5.9.5']
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@v3
- name: Read .node-version
run: echo "{NODEVERSION}={$(cat .node-version)}" >> $GITHUB_OUTPUT
id: nodenv
- name: Setup Node.js (.node-version)
uses: actions/setup-node@v3
with:
node-version: '${{ steps.nodenv.outputs.NODEVERSION }}'
- name: Cache multiple paths
uses: actions/cache@v3
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 Packages
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
- name: Build
run: npm run build
- name: Start Environment
run: npx wp-env start
- name: Run PHP Unit Test
run: npm run phpunit
62 changes: 62 additions & 0 deletions .github/workflows/wp-plugin-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,73 @@ on:
env:
plugin_name: vk-block-patterns
jobs:
php_unit:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['7.4', '8.0', '8.1']
wp-versions: ['6.1.1', '6.0.3', '5.9.5']
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 "{NODEVERSION}={$(cat .node-version)}" >> $GITHUB_OUTPUT
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
# dist の中で build は実行している
- name: Build and Dist
run: npm run dist

# PHPUnit
- name: PHP Unit Test
run: npm run phpunit
tag:
name: deploy to plugin directory
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
needs: [php_unit]
steps:
- uses: actions/checkout@master
- name: Build
Expand All @@ -27,6 +88,7 @@ jobs:
release:
name: release
runs-on: ubuntu-latest
needs: [php_unit]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
Expand Down
File renamed without changes.
7 changes: 6 additions & 1 deletion .wp-env.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,10 @@
"core": null,
"plugins": [
"."
]
],
"config": {
"WP_DEBUG": true,
"SCRIPT_DEBUG": true,
"FS_METHOD": "direct"
}
}
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
}
],
"require-dev": {
"wp-phpunit/wp-phpunit": "^5.4"
"wp-phpunit/wp-phpunit": "^5.4",
"yoast/phpunit-polyfills": "^1.0",
"doctrine/instantiator": "^1.5"
}
}
Loading

0 comments on commit baef391

Please sign in to comment.