Skip to content

Commit

Permalink
Merge fc807fd into 0603f83
Browse files Browse the repository at this point in the history
  • Loading branch information
kidunot89 committed Feb 20, 2020
2 parents 0603f83 + fc807fd commit 00e2746
Show file tree
Hide file tree
Showing 11 changed files with 143 additions and 150 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/testing-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Testing Integration

on:
push:
branches:
- develop
- master
pull_request:
branches:
- develop

jobs:
run:
runs-on: ubuntu-latest
env:
coverage: 0
debug: 0
strategy:
matrix:
php: ['7.3', '7.2', '7.1', '7.0']
wordpress: ['5.3', '5.0', '4.9']
include:
- php: '7.0'
use_xdebug: 1
- php: '7.0'
wordpress: '5.0'
coverage: 1

exclude:
- php: '7.3'
wordpress: '4.9'
- php: '7.2'
wordpress: '4.9'
- php: '7.0'
wordpress: '5.3'
fail-fast: false
name: WordPress ${{ matrix.wordpress }} on PHP ${{ matrix.php }}
steps:
- name: Checkout
uses: actions/checkout@v1

- name: Build "testing" Docker Image
run: |
docker-compose build \
--build-arg PHP_VERSION=${{ matrix.php }} \
--build-arg WP_VERSION=${{ matrix.wordpress }} \
--build-arg USE_XDEBUG=${{ matrix.use_xdebug }} \
testing
- name: Run Tests w/ Docker.
run: |
docker-compose run --rm \
-e COVERAGE=${{ matrix.coverage }} \
-e DEBUG=${{ matrix.debug }} \
testing --scale app=0
- name: Push Codecoverage to Coveralls.io
if: matrix.coverage == 1
env:
COVERALLS_RUN_LOCALLY: 1
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: |
wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.1.0/php-coveralls.phar
chmod +x php-coveralls.phar
php php-coveralls.phar -v
52 changes: 52 additions & 0 deletions .github/workflows/wordpress-coding-standard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: WordPress Coding Standards

on:
push:
branches:
- develop
- master
pull_request:
branches:
- develop

jobs:
run:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1

- name: Setup PHP
if: matrix.phpcs == 1
uses: shivammathur/setup-php@v1
with:
php-version: 7.3
extensions: mbstring, intl
tools: composer

- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Install dependencies
run: |
composer require \
squizlabs/php_codesniffer \
phpcompatibility/phpcompatibility-wp wp-coding-standards/wpcs \
dealerdirect/phpcodesniffer-composer-installer
composer install --no-dev
- name: Cache dependencies
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer

- name: Run PHP CodeSniffer
run: |
vendor/bin/phpcs \
wp-graphql-woocommerce.php \
access-functions.php \
class-inflect.php \
includes/*.php
5 changes: 1 addition & 4 deletions .phpcs.ruleset.xml → .phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@
<!-- Rules: WordPress Coding Standards -->
<!-- https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards -->
<!-- https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties -->
<config name="minimum_supported_wp_version" value="4.6"/>
<rule ref="WordPress">
<exclude name="WordPress.VIP"/>
</rule>
<config name="minimum_supported_wp_version" value="4.9"/>
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<properties>
<!-- Value: replace the function, class, and variable prefixes used. Separate multiple prefixes with a comma. -->
Expand Down
115 changes: 0 additions & 115 deletions .travis.yml

This file was deleted.

16 changes: 8 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
############################################################################

# Using the 'DESIRED_' prefix to avoid confusion with environment variables of the same name.
ARG DESIRED_WP_VERSION
ARG DESIRED_PHP_VERSION
ARG WP_VERSION
ARG PHP_VERSION

FROM kidunot89/woographql-app:wp${DESIRED_WP_VERSION}-php${DESIRED_PHP_VERSION}
FROM kidunot89/woographql-app:wp${WP_VERSION}-php${PHP_VERSION}


LABEL author=kidunot89
Expand All @@ -15,11 +15,11 @@ LABEL author_uri=https://github.com/kidunot89
SHELL [ "/bin/bash", "-c" ]

# Redeclare ARGs and set as environmental variables for reuse.
ARG DESIRED_WP_VERSION
ARG DESIRED_PHP_VERSION
ARG WP_VERSION
ARG PHP_VERSION
ARG USE_XDEBUG
ENV WP_VERSION=${DESIRED_WP_VERSION}
ENV PHP_VERSION=${DESIRED_PHP_VERSION}
ENV WP_VERSION=${WP_VERSION}
ENV PHP_VERSION=${PHP_VERSION}
ENV USING_XDEBUG=${USE_XDEBUG}

# Install php extensions
Expand All @@ -37,7 +37,7 @@ RUN if [ "$PHP_VERSION" != "5.6" ] && [ "$PHP_VERSION" != "7.0" ] && [[ -z "$USI
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_enable=on" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_autostart=off" >> /usr/local/etc/php/conf.d/xdebug.ini; \
elif [ "$PHP_VERSION" == "7.0" ]; then \
elif [ "$PHP_VERSION" == "7.0" ] || [ ! -z "$USING_XDEBUG" ]; then \
yes | pecl install xdebug-2.6.1 \
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_enable=on" >> /usr/local/etc/php/conf.d/xdebug.ini \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<a href="https://woographql.axistaylor.com/" target="_blank">Docs</a> • <a href="https://www.axistaylor.com" target="_blank">AxisTaylor</a> • <a href="https://wpgql-slack.herokuapp.com/" target="_blank">Join Slack</a>

[![Build Status](https://travis-ci.org/wp-graphql/wp-graphql-woocommerce.svg?branch=develop)](https://travis-ci.org/wp-graphql/wp-graphql-woocommerce) [![Coverage Status](https://coveralls.io/repos/github/wp-graphql/wp-graphql-woocommerce/badge.svg?branch=develop)](https://coveralls.io/github/wp-graphql/wp-graphql-woocommerce?branch=develop)
[![Actions Status](https://github.com/wp-graphql/wp-graphql-woocommerce/workflows/Testing Integration/badge.svg)](https://github.com/wp-graphql/wp-graphql-woocommerce/actions)[![Coverage Status](https://coveralls.io/repos/github/wp-graphql/wp-graphql-woocommerce/badge.svg?branch=develop)](https://coveralls.io/github/wp-graphql/wp-graphql-woocommerce?branch=develop)

## Quick Install
1. Install & activate [WooCommerce](https://woocommerce.com/)
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ services:
context: .
dockerfile: Dockerfile
args:
- DESIRED_PHP_VERSION="${PHP_VERSION:-7.3}"
- DESIRED_WP_VERSION="${WP_VERSION:-5.2}"
- PHP_VERSION="${PHP_VERSION:-7.3}"
- WP_VERSION="${WP_VERSION:-5.2}"
- USE_XDEBUG
image: woographql-testing
volumes:
Expand Down
9 changes: 1 addition & 8 deletions includes/model/class-coupon.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
<?php
/**
* Model - Coupon
*
* Resolves coupon crud object model
*
* @package WPGraphQL\WooCommerce\Model
* @since 0.0.1
*/


namespace WPGraphQL\WooCommerce\Model;

Expand Down
2 changes: 1 addition & 1 deletion vendor/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInitcab7a6a7239ac8af7f5a764eb6b56ee1::getLoader();
return ComposerAutoloaderInitc1b6563d844021ea0246bd702005f918::getLoader();
14 changes: 7 additions & 7 deletions vendor/composer/autoload_real.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// autoload_real.php @generated by Composer

class ComposerAutoloaderInitcab7a6a7239ac8af7f5a764eb6b56ee1
class ComposerAutoloaderInitc1b6563d844021ea0246bd702005f918
{
private static $loader;

Expand All @@ -19,15 +19,15 @@ public static function getLoader()
return self::$loader;
}

spl_autoload_register(array('ComposerAutoloaderInitcab7a6a7239ac8af7f5a764eb6b56ee1', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInitc1b6563d844021ea0246bd702005f918', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInitcab7a6a7239ac8af7f5a764eb6b56ee1', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInitc1b6563d844021ea0246bd702005f918', 'loadClassLoader'));

$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require_once __DIR__ . '/autoload_static.php';

call_user_func(\Composer\Autoload\ComposerStaticInitcab7a6a7239ac8af7f5a764eb6b56ee1::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInitc1b6563d844021ea0246bd702005f918::getInitializer($loader));
} else {
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
Expand All @@ -48,19 +48,19 @@ public static function getLoader()
$loader->register(true);

if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInitcab7a6a7239ac8af7f5a764eb6b56ee1::$files;
$includeFiles = Composer\Autoload\ComposerStaticInitc1b6563d844021ea0246bd702005f918::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequirecab7a6a7239ac8af7f5a764eb6b56ee1($fileIdentifier, $file);
composerRequirec1b6563d844021ea0246bd702005f918($fileIdentifier, $file);
}

return $loader;
}
}

function composerRequirecab7a6a7239ac8af7f5a764eb6b56ee1($fileIdentifier, $file)
function composerRequirec1b6563d844021ea0246bd702005f918($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;
Expand Down
Loading

0 comments on commit 00e2746

Please sign in to comment.