Skip to content

Commit

Permalink
Merge pull request #80 from thefrosty/develop
Browse files Browse the repository at this point in the history
2.7.0
  • Loading branch information
thefrosty authored Apr 18, 2023
2 parents d896deb + 30a4395 commit c0aca98
Show file tree
Hide file tree
Showing 18 changed files with 428 additions and 317 deletions.
4 changes: 2 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ tests/ export-ignore
vendor/ export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.travis.yml export-ignore
phpcs.ruleset.xml export-ignore
docker-compose.yml export-ignore
phpcs-ruleset.xml export-ignore
phpunit.xml export-ignore
77 changes: 77 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Main PHP Version(s) CI

on:
push:
branches:
- develop
pull_request:

# Cancels all previous workflow runs for the same branch that have not yet completed.
concurrency:
# The concurrency group contains the workflow name and the branch name.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
Test:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ ubuntu-latest ]
php-versions: [ '8.0', '8.1' ]
wp-versions: [ '6.1', 'latest' ]
coverage: [ true ]
services:
mysql:
image: mysql:8.0
env:
MYSQL_DATABASE: wordpress_test
MYSQL_PASSWORD: password
MYSQL_USER: wp
MYSQL_ROOT_PASSWORD: root
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=10s --health-retries=10

name: WP ${{ matrix.wp-versions }} on PHP ${{ matrix.php-versions }}
env:
WORDPRESS_DB_NAME: wordpress_test
WORDPRESS_DB_PASS: password
WORDPRESS_DB_USER: wp
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0 # No shallow clone, we need all history!

- name: Setup PHP ${{ matrix.php-versions }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mysql, mysqli
coverage: xdebug
tools: composer, cs2pr, phpunit

- name: Setup WordPress ${{ matrix.wp-versions }}
run: bash bin/install-wp-tests.sh wordpress_test wp password localhost ${{ matrix.wp-versions }} true

- name: Install dependencies
run: composer update --prefer-dist --no-interaction

- name: Create all branches
run: source ./vendor/thefrosty/wp-utilities/bin/create-all-branches.sh

- name: Run composer tests
id: tests
run: composer tests
env:
DB_PORT: ${{ job.services.mysql.ports[3306] }}

- name: Show PHPCS results in PR
if: ${{ always() && steps.tests.outcome == 'failure' }}
run: cs2pr ./phpcs-report.xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: false
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
.DS_Store
.idea/
coverage/
.phpunit.result.cache
tests/results/
tests/clover.xml
vendor/
wordpress/
composer.lock
phpunit.xml.bak
phpcs-report.xml
47 changes: 0 additions & 47 deletions .travis.yml

This file was deleted.

3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
[![Latest Stable Version](https://img.shields.io/packagist/v/thefrosty/wp-upgrade-task-runner.svg)](https://packagist.org/packages/thefrosty/wp-upgrade-task-runner)
[![Total Downloads](https://img.shields.io/packagist/dt/thefrosty/wp-upgrade-task-runner.svg)](https://packagist.org/packages/thefrosty/wp-upgrade-task-runner)
[![License](https://img.shields.io/packagist/l/thefrosty/wp-upgrade-task-runner.svg)](https://packagist.org/packages/thefrosty/wp-upgrade-task-runner)
[![Build Status](https://travis-ci.org/thefrosty/wp-upgrade-task-runner.svg?branch=master)](https://travis-ci.org/thefrosty/wp-upgrade-task-runner)
![Build Status](https://github.com/thefrosty/wp-upgrade-task-runner/actions/workflows/main.yml/badge.svg)
[![codecov](https://codecov.io/gh/thefrosty/wp-upgrade-task-runner/branch/develop/graph/badge.svg)](https://codecov.io/gh/thefrosty/wp-upgrade-task-runner)

Register custom migration tasks that can be triggered from a dashboard in the admin and run via AJAX.

Expand Down
29 changes: 0 additions & 29 deletions bin/create-all-branches.sh

This file was deleted.

45 changes: 0 additions & 45 deletions bin/phpcs.sh

This file was deleted.

25 changes: 13 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,30 @@
},
"optimize-autoloader": true,
"platform": {
"php": "7.4.26"
"php": "8.0"
},
"process-timeout": 600,
"sort-packages": true
},
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": "^7.4 || ^8.0",
"php": "^8.0",
"pimple/pimple": "^3.2",
"symfony/http-foundation": "^5.2 || ~6.0",
"thefrosty/wp-utilities": "^2.5.1"
"thefrosty/wp-utilities": "^3.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
"dealerdirect/phpcodesniffer-composer-installer": "^1.0.0",
"ext-simplexml": "*",
"phpcompatibility/php-compatibility": "^9.3",
"phpunit/phpunit": "^9",
"roots/wordpress": "~5.9.1",
"slevomat/coding-standard": "^4",
"squizlabs/php_codesniffer": "^3.2",
"roots/wordpress": "~6.1",
"slevomat/coding-standard": "^8.8",
"squizlabs/php_codesniffer": "^3.7",
"wp-cli/wp-cli-bundle": "^2.4",
"wp-coding-standards/wpcs": "^2.3",
"wp-phpunit/wp-phpunit": "~5.9.1",
"wp-coding-standards/wpcs": "dev-develop",
"wp-phpunit/wp-phpunit": "~6.1",
"yoast/phpunit-polyfills": "^1.0.1"
},
"autoload": {
Expand All @@ -54,7 +55,7 @@
},
"autoload-dev": {
"psr-4": {
"TheFrosty\\WpUpgradeTaskRunner\\PhpUnit\\": "tests/unit"
"TheFrosty\\Tests\\WpUpgradeTaskRunner\\": "tests/unit"
}
},
"scripts": {
Expand All @@ -65,10 +66,10 @@
"@install-codestandards"
],
"phpcs": [
"bash ./bin/phpcs.sh"
"bash ./vendor/thefrosty/wp-utilities/bin/phpcs.sh"
],
"phpunit": [
"./vendor/bin/phpunit --colors"
"./vendor/bin/phpunit --colors --verbose --coverage-html ./tests/results && php ./tests/clover-results.php ./tests/clover.xml 01"
],
"tests": [
"@phpcs",
Expand Down
33 changes: 33 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
version: '3.3'

services:
db:
image: mysql:5.6
command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
volumes:
- db_data:/var/lib/mysql
ports:
- "3306:3306"
environment:
MYSQL_DATABASE: wordpress_test
MYSQL_ROOT_PASSWORD: mysql_root_password
MYSQL_USER: wordpress_user
MYSQL_PASSWORD: mysql_password
restart: always

phpfpm:
image: php:8.0-fpm-alpine
depends_on:
- db
deploy:
replicas: 4
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_NAME: wordpress_test
WORDPRESS_DB_PASSWORD: mysql_password
WORDPRESS_DB_PREFIX: wp_
WORDPRESS_DB_USER: wordpress_user
restart: always

volumes:
db_data:
Loading

0 comments on commit c0aca98

Please sign in to comment.