Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
justlevine committed May 14, 2022
0 parents commit d2f4884
Show file tree
Hide file tree
Showing 124 changed files with 5,525 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .env.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
DB_NAME=wordpress
DB_HOST=app_db
DB_USER=wordpress
DB_PASSWORD=wordpress
WP_TABLE_PREFIX=wp_
WP_URL=http://localhost
WP_DOMAIN=localhost
ADMIN_EMAIL=admin@example.com
ADMIN_USERNAME=admin
ADMIN_PASSWORD=root
ADMIN_PATH=/wp-admin

TEST_DB_NAME=wptests
TEST_DB_HOST=127.0.0.1
TEST_DB_USER=root
TEST_DB_PASSWORD=
TEST_WP_TABLE_PREFIX=wp_
TEST_WP_ROOT_FOLDER=/tmp/wordpress
TEST_ADMIN_EMAIL=admin@wp.test

SKIP_DB_CREATE=false
TESTS_DIR=tests
TESTS_OUTPUT=tests/_output
TESTS_DATA=tests/_data
TESTS_SUPPORT=tests/_support
TESTS_ENVS=tests/_envs

CORE_BRANCH=develop
SKIP_TESTS_CLEANUP=1
SUITES=wpunit

PLUGIN_SLUG=wp-graphql-plugin-name
63 changes: 63 additions & 0 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Code Quality

on:
push:
branches:
- develop
- main
pull_request_target:
branches:
- develop
- main
jobs:
run:
runs-on: ubuntu-latest
name: Check code
services:
mariadb:
image: mariadb
ports:
- 3306:3306
env:
MYSQL_ROOT_PASSWORD: root
# Ensure docker waits for mariadb to start
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP w/ Composer & WP-CLI
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
extensions: mbstring, intl, bcmath, exif, gd, mysqli, opcache, zip, pdo_mysql
coverage: none
tools: composer, wp-cli

- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
working-directory: ./wp-graphql-plugin-name

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: php-${{ matrix.php }}-${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: php-${{ matrix.php }}N-${{ runner.os }}-composer

- name: Install dependencies
run: composer install
working-directory: ./wp-graphql-plugin-name

- name: Setup WordPress
run: |
cp .env.dist .env
composer run install-stan-env
cp -R . /tmp/wordpress/wp-content/plugins/wp-graphql-plugin-name
working-directory: ./wp-graphql-plugin-name

- name: Run PHPStan
working-directory: /tmp/wordpress/wp-content/plugins/wp-graphql-plugin-name
run: composer run-script phpstan
46 changes: 46 additions & 0 deletions .github/workflows/code-standard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: WordPress Coding Standards

on:
push:
branches:
- develop
- main
pull_request:
branches:
- develop
- main
jobs:
run:
runs-on: ubuntu-latest
name: Checkout repo
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
extensions: mbstring, intl
tools: composer

- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
working-directory: ./wp-graphql-plugin-name


- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer

- name: Install dependencies
run: composer install
working-directory: ./wp-graphql-plugin-name

- name: Run PHP_CodeSniffer
run: composer run-script check-cs
working-directory: ./wp-graphql-plugin-name
27 changes: 27 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.devcontainer/*
.devcontainer.json
.DS_Store
.env
.env.*
!.env.dist
.idea
.log/
.vscode
*.sql
*.tar.gz
.scannerwork
auth.json
build/
coverage/*
node_modules/
phpcs.xml
phpunit.xml
schema.graphql
sonar-project.properties
sonar-scanner
composer.lock
!tests
tests/*.suite.yml
Thumbs.db
wp-cli.local.yml
vendor
48 changes: 48 additions & 0 deletions .phpcs.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0"?>
<ruleset name="Coding Standards for WPGraphQL Plugin Boilerplate">
<description>Sniffs for WPGraphQL Plugin Boilerplate.</description>
<!-- What to scan -->
<file>./wp-graphql-plugin-name/access-functions.php</file>
<file>./wp-graphql-plugin-name/wp-graphql-plugin-name.php</file>
<file>./wp-graphql-plugin-name/activation.php</file>
<file>./wp-graphql-plugin-name/deactivation.php</file>
<file>./wp-graphql-plugin-name/src/</file>
<file>./src/</file>
<exclude-pattern>/vendor/</exclude-pattern>
<exclude-pattern>/node_modules/</exclude-pattern>
<!-- How to scan -->
<!-- Usage instructions: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage -->
<!-- Annotated ruleset: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml -->
<arg value="sp"/>
<!-- Show sniff and progress -->
<arg name="basepath" value="./"/>
<!-- Strip the file paths down to the relevant bit -->
<arg name="colors"/>
<arg name="extensions" value="php"/>
<!-- Enables parallel processing when available for faster results. -->
<arg name="parallel" value="8"/>

<!-- WPGraphQL Plugin Boilerplate ruleset -->
<rule ref="./standards/ruleset.xml" />

<!-- Tests for PHP version compatibility -->
<rule ref="PHPCompatibilityWP">
<config name="testVersion" value="7.0-"/>
</rule>

<!-- https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties -->
<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. -->
<property name="prefixes" type="array" value=" AxeWP\GraphQL, wp_graphql, WPGraphQL\PluginName, graphql_pb, WPGRAPHQL_PB" />
</properties>
</rule>
<rule ref="WordPress.WP.I18n">
<properties>
<!-- Value: replace the text domain used. -->
<property name="text_domain" type="array" value="wp-graphql-plugin-name"/>
</properties>
</rule>
</ruleset>
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Changelog

@todo
Loading

0 comments on commit d2f4884

Please sign in to comment.