Skip to content

Commit

Permalink
release
Browse files Browse the repository at this point in the history
  • Loading branch information
afragen committed Sep 10, 2023
2 parents 7a0584f + cc32eb0 commit c2051b2
Show file tree
Hide file tree
Showing 16 changed files with 1,043 additions and 125 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Get tag
id: tag
Expand Down
79 changes: 38 additions & 41 deletions .github/workflows/wp-phpunit.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Based on https://github.com/wp-cli/scaffold-command/blob/f9bad3dd7224d5684d950d31c486df70905e386f/templates/plugin-github.mustache
# Thanks Josh https://github.com/Shelob9/wordpress-plugin/blob/main/.github/workflows/wordpress.yml
# Thanks https://github.com/shivammathur
# Thanks Alex Stine for rubber ducking and help figuring out MySQL 5.7
# Thanks @desrosj for idea to just use MySQL 8.0 with correct authentication method.
name: WordPress Tests

on:
Expand All @@ -15,48 +17,43 @@ on:

jobs:
run:
runs-on: ${{ matrix.operating-system }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ['7.4', '8.0', '8.1']
phpunit-versions: ['9.5.20']
include:
- php-versions: '7.2'
phpunit-versions: '7.5.20'
operating-system: ubuntu-18.04
- php-versions: '7.3'
phpunit-versions: '9.5.20'
operating-system: 'ubuntu-18.04'
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
php-versions: ["7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3"]

name: PHP ${{ matrix.php-versions }} Test on ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: none
extensions: mysql
tools: wp-cli, phpunit-polyfills, phpunit:${{ matrix.phpunit-versions }}
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Check PHP Version
run: php -v

- name: Composer install
run: composer install --optimize-autoloader --prefer-dist

- name: Start Mysql
run: sudo service mysql start

- name: Install WP Tests
run: bash bin/install-wp-tests.sh wordpress_test root root localhost latest

- name: phpunit tests
run: |
echo "define('WP_TESTS_PHPUNIT_POLYFILLS_PATH', '$HOME/.composer/vendor/yoast/phpunit-polyfills');" >> /tmp/wordpress-tests-lib/wp-tests-config.php
/usr/local/bin/phpunit --config=phpunit.xml
- name: Checkout
uses: actions/checkout@v3

- name: Setup MySQL 8.0 with mysql_native_password
uses: shogo82148/actions-setup-mysql@v1
with:
mysql-version: "8.0"
my-cnf: |
bind_address=127.0.0.1
default-authentication-plugin=mysql_native_password
root-password: root

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: none
extensions: mysql, mysqli
tools: composer, wp-cli, phpunit-polyfills:1.0
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Composer install
run: composer install --optimize-autoloader --prefer-dist

- name: Install WP Tests
run: bash bin/install-wp-tests.sh wordpress_test root root 127.0.0.1 latest

- name: PHPUnit tests
run: |
echo "define('WP_TESTS_PHPUNIT_POLYFILLS_PATH', '$HOME/.composer/vendor/yoast/phpunit-polyfills');" >> /tmp/wordpress-tests-lib/wp-tests-config.php
phpunit --config=phpunit.xml
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
.DS_Store
.idea
.vscode

vendor/bin
vendor/dealerdirect
vendor/squizlabs
vendor/wp-coding-standards
vendor/phpcsstandards
vendor/wp-coding-standards
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
[unreleased]

#### 2.0.3 / 2023-09-10
* WPCS 3.0.0

#### 2.0.2 / 2022-11-30
* update GitHub Action

Expand Down
15 changes: 13 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,26 @@
"require": {
"php": ">=7.2"
},
"require-dev": {
"wp-coding-standards/wpcs": "^3.0.0"
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
},
"autoload": {
"psr-4": {
"Fragen\\Git_Updater\\Gist\\": "src/",
"Fragen\\Git_Updater\\API\\": "src/Gist/"
}
},
"scripts": {
"post-update-cmd": [
"wp i18n make-pot . languages/git-updater-gist.pot"
"make-pot": [
"wp i18n make-pot . languages/git-updater.pot"
],
"wpcs": [
"vendor/bin/phpcbf .; vendor/bin/phpcs ."
]
}
}
Loading

0 comments on commit c2051b2

Please sign in to comment.