Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Commit

Permalink
- updates the WPGraphQL for ACF Test environment to properly run test…
Browse files Browse the repository at this point in the history
…s in Github actions when Pull Requests are opened.

- Updates test for range field to assert it's a float
  • Loading branch information
jasonbahl committed Feb 19, 2021
1 parent 2545c2f commit d8a917f
Show file tree
Hide file tree
Showing 65 changed files with 22,597 additions and 7,656 deletions.
35 changes: 35 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# The following files should be ignored:
# - unencrypted sensitive data
# - files that are not checked into the code repository
# - files that are not relevant to the Docker build

.git
.idea
bin
docker-output
docs
img

tests/_output
!tests/_output/.gitignore
tests/_support/_generated
!tests/_support/_generated/.gitignore

vendor
!vendor/autoload.php
!vendor/ivome/graphql-relay-php/src
!vendor/webonyx/graphql-php/src
!vendor/composer

.dockerignore
.gitignore
.travis.yml
CODE_OF_CONDUCT.md
CONTRIBUTING.md
Dockerfile*
ISSUE_TEMPLATE.md
LICENSE
PULL_REQUEST_TEMPLATE.md
README.md
readme.txt
run-docker*.sh
48 changes: 28 additions & 20 deletions .env.dist
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
# Shared
TEST_DB_NAME="wptests"
TEST_DB_HOST="127.0.0.1"
TEST_DB_USER="root"
TEST_DB_PASSWORD=""
DB_NAME=wordpress
DB_HOST=app_db
DB_USER=wordpress
DB_PASSWORD=wordpress
WP_TABLE_PREFIX=wp_
WP_URL=http://localhost
WP_DOMAIN=localhost
[email protected]
ADMIN_USERNAME=admin
ADMIN_PASSWORD=password
ADMIN_PATH=/wp-admin

TEST_DB_NAME=wpgraphql_acf_tests
TEST_DB_HOST=127.0.0.1
TEST_DB_USER=wordpress
TEST_DB_PASSWORD=wordpress
TEST_WP_TABLE_PREFIX=wp_

# Install script
WP_VERSION=latest
SKIP_DB_CREATE=false
TEST_WP_ROOT_FOLDER=/tmp/wordpress
[email protected]

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

# Codeception
WP_ROOT_FOLDER="/tmp/wp-graphql-acf/wordpress"
WP_ADMIN_PATH="/wp-admin"
DB_NAME="wptests"
DB_HOST="127.0.0.1"
DB_USER="root"
DB_PASSWORD=""
WP_TABLE_PREFIX="wp_"
WP_URL="http://wp.test"
WP_DOMAIN="wp.test"
ADMIN_EMAIL="[email protected]"
ADMIN_USERNAME="admin"
ADMIN_PASSWORD="password"
CORE_BRANCH=develop
SKIP_TESTS_CLEANUP=1
SUITES=wpunit
46 changes: 46 additions & 0 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Coding-Standards

on:
push:
branches:
- develop
- master
pull_request:
branches:
- develop
paths:
- '**.php'
- '!docs/**'

jobs:
lint_code:
runs-on: ubuntu-latest
name: "Lint code with PHPCS"
steps:
- name: Checkout
uses: actions/checkout@v1

- name: Setup PHP
uses: shivammathur/setup-php@v2
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 install
- 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: composer lint
84 changes: 84 additions & 0 deletions .github/workflows/testing-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Testing Integration

on:
push:
branches:
- develop
- master
pull_request:
branches:
- develop
- master
paths:
- '**.php'
- '!docs/**'

jobs:
continuous_integration:
runs-on: ubuntu-latest
strategy:
matrix:
php: [ '7.3', '7.4' ]
wordpress: [ '5.6', '5.5.3', '5.4.2' ]
include:
- php: '7.4'
wordpress: '5.6'
coverage: 1
- php: '7.4'
wordpress: '5.5.3'
- php: '7.4'
wordpress: '5.4.2'
- php: '7.3'
wordpress: '5.6'
- php: '7.3'
wordpress: '5.5.3'
- php: '7.3'
wordpress: '5.4.2'
fail-fast: false
name: WordPress ${{ matrix.wordpress }} on PHP ${{ matrix.php }}
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: json, mbstring

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

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

- name: Install dependencies
run: composer install --no-dev

- name: Build "testing" Docker Image
env:
PHP_VERSION: ${{ matrix.php }}
WP_VERSION: ${{ matrix.wordpress }}
USE_XDEBUG: ${{ matrix.coverage }}
run: composer build-test

- name: Run Tests w/ Docker.
env:
COVERAGE: ${{ matrix.coverage }}
USE_XDEBUG: ${{ matrix.coverage }}
DEBUG: ${{ matrix.debug }}
SKIP_TESTS_CLEANUP: ${{ matrix.coverage }}
LOWEST: ${{ matrix.lowest }}
run: composer run-test

- name: Push Codecoverage to Coveralls.io
if: ${{ matrix.coverage == 1 }}
env:
COVERALLS_RUN_LOCALLY: 1
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: vendor/bin/php-coveralls -v
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ vendor/*
vendor/composer/installed.json
vendor/composer/*/
composer.lock
.log
67 changes: 0 additions & 67 deletions .travis.yml

This file was deleted.

Loading

0 comments on commit d8a917f

Please sign in to comment.