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

Commit

Permalink
Merge pull request #279 from wp-graphql/feature/#275-generate-schema-…
Browse files Browse the repository at this point in the history
…artifact

Generate Schema Artifact
  • Loading branch information
jasonbahl authored Jul 19, 2021
2 parents f34bb96 + 58d25e3 commit 4d62d71
Show file tree
Hide file tree
Showing 12 changed files with 51 additions and 49 deletions.
4 changes: 2 additions & 2 deletions .env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ 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_DB_USER=root
TEST_DB_PASSWORD=root
TEST_WP_TABLE_PREFIX=wp_

SKIP_DB_CREATE=false
Expand Down
32 changes: 11 additions & 21 deletions .github/workflows/upload-schema-artifact.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
name: Schema Artifact
name: Upload Schema Artifact

on:
workflow_dispatch:
push:
branches:
- develop
- master
pull_request:
branches:
- develop
- master
release:
types: [ published ]

jobs:
run:
Expand Down Expand Up @@ -42,21 +35,18 @@ jobs:
- name: Install WP CLI for ACF
run: |
cd /tmp/wordpress/
wp plugin install https://github.com/hoppinger/advanced-custom-fields-wpcli/archive/refs/heads/master.zip --activate
wp plugin install https://github.com/hoppinger/advanced-custom-fields-wpcli/archive/refs/heads/master.zip --activate --path="/tmp/wordpress"
- name: Import test Field Group
run: |
echo ${GITHUB_WORKSPACE}/docs/field-group-examples-export.json
wp acf import --json_file="${GITHUB_WORKSPACE}/docs/field-group-examples-export.json"
wp acf import --json_file="${GITHUB_WORKSPACE}/docs/field-group-examples-export.json" --path="/tmp/wordpress"
- name: Generate the Static Schema
run: |
cd /tmp/wordpress/
# Output: /tmp/schema.graphql
wp graphql generate-static-schema
echo "$(</tmp/schema.graphql )"
# - name: Upload schema as release artifact
# uses: softprops/action-gh-release@v1
# with:
# files: /tmp/schema.graphql
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload schema as release artifact
uses: softprops/action-gh-release@v1
with:
files: /tmp/schema.graphql
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ vendor/composer/installed.json
vendor/composer/*/
composer.lock
.log
local
wp-content

11 changes: 4 additions & 7 deletions bin/install-test-env.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
#!/usr/bin/env bash

if [[ ! -f ".env" ]]; then
if [ ! -f .env ]; then
echo "No .env file was detected. .env.dist has been copied to .env"
echo "Open the .env file and enter values to match your local environment"
cp .env.dist .env
cp ./.env.dist ./.env
export $(cat .env | xargs)
fi

source .env.dist

env | sort
source .env

print_usage_instruction() {
echo "Ensure that .env file exist in project root directory exists."
Expand Down Expand Up @@ -140,8 +139,6 @@ install_db() {
fi
fi

env | sort

# create database
RESULT=`mysql -u $DB_USER --password="$DB_PASS" --skip-column-names -e "SHOW DATABASES LIKE '$DB_NAME'"$EXTRA`
if [ "$RESULT" != $DB_NAME ]; then
Expand Down
12 changes: 11 additions & 1 deletion bin/run-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,17 @@ if [ -z "$1" ]; then
print_usage_instructions
fi

BUILD_NO_CACHE=
TAG=${TAG-latest}
WP_VERSION=${WP_VERSION-5.6}
PHP_VERSION=${PHP_VERSION-7.4}

BUILD_NO_CACHE=${BUILD_NO_CACHE-}

if [[ ! -f ".env" ]]; then
echo "No .env file was detected. .env.dist has been copied to .env"
echo "Open the .env file and enter values to match your local environment"
cp .env.dist .env
fi

subcommand=$1; shift
case "$subcommand" in
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"phpstan": ["phpstan analyze --ansi --memory-limit=1G"]
},
"require": {
"php": "^7"
"php": "^7.1 || ^8.0"
},
"require-dev": {
"lucatume/wp-browser": "^2.4",
Expand Down
2 changes: 1 addition & 1 deletion docker/app.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ RUN curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli
# Set project environmental variables
ENV WP_ROOT_FOLDER="/var/www/html"
ENV PLUGINS_DIR="${WP_ROOT_FOLDER}/wp-content/plugins"
ENV PROJECT_DIR="${PLUGINS_DIR}/wp-graphql"
ENV PROJECT_DIR="${PLUGINS_DIR}/wp-graphql-acf"
ENV DATA_DUMP_DIR="${PROJECT_DIR}/tests/_data"

# Remove exec statement from base entrypoint script.
Expand Down
4 changes: 3 additions & 1 deletion docker/app.post-setup.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/bin/bash

# Activate wp-graphql
wp plugin activate wp-graphql --allow-root
wp plugin install https://github.com/wp-premium/advanced-custom-fields-pro/archive/refs/heads/master.zip --activate --allow-root
wp plugin install wp-graphql --allow-root --activate
wp plugin activate wp-graphql-acf --allow-root

# Set pretty permalinks.
wp rewrite structure '/%year%/%monthnum%/%postname%/' --allow-root
Expand Down
2 changes: 1 addition & 1 deletion docker/testing.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
ARG WP_VERSION
ARG PHP_VERSION

FROM wp-graphql:latest-wp${WP_VERSION}-php${PHP_VERSION}
FROM wpgraphql-acf-app:latest

LABEL author=jasonbahl
LABEL author_uri=https://github.com/jasonbahl
Expand Down
12 changes: 6 additions & 6 deletions vendor/composer/InstalledVersions.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,24 @@ class InstalledVersions
private static $installed = array (
'root' =>
array (
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'pretty_version' => 'dev-develop',
'version' => 'dev-develop',
'aliases' =>
array (
),
'reference' => 'dc5e83d190211baf88978a905ff44a9122fdaff8',
'reference' => 'f34bb96ba52af54541439299b04e2b95d4f7564a',
'name' => 'wp-graphql/wp-graphql-acf',
),
'versions' =>
array (
'wp-graphql/wp-graphql-acf' =>
array (
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'pretty_version' => 'dev-develop',
'version' => 'dev-develop',
'aliases' =>
array (
),
'reference' => 'dc5e83d190211baf88978a905ff44a9122fdaff8',
'reference' => 'f34bb96ba52af54541439299b04e2b95d4f7564a',
),
),
);
Expand Down
12 changes: 6 additions & 6 deletions vendor/composer/installed.php
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<?php return array (
'root' =>
array (
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'pretty_version' => 'dev-develop',
'version' => 'dev-develop',
'aliases' =>
array (
),
'reference' => 'dc5e83d190211baf88978a905ff44a9122fdaff8',
'reference' => 'f34bb96ba52af54541439299b04e2b95d4f7564a',
'name' => 'wp-graphql/wp-graphql-acf',
),
'versions' =>
array (
'wp-graphql/wp-graphql-acf' =>
array (
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'pretty_version' => 'dev-develop',
'version' => 'dev-develop',
'aliases' =>
array (
),
'reference' => 'dc5e83d190211baf88978a905ff44a9122fdaff8',
'reference' => 'f34bb96ba52af54541439299b04e2b95d4f7564a',
),
),
);
4 changes: 2 additions & 2 deletions vendor/composer/platform_check.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

$issues = array();

if (!(PHP_VERSION_ID >= 70000)) {
$issues[] = 'Your Composer dependencies require a PHP version ">= 7.0.0". You are running ' . PHP_VERSION . '.';
if (!(PHP_VERSION_ID >= 70100)) {
$issues[] = 'Your Composer dependencies require a PHP version ">= 7.1.0". You are running ' . PHP_VERSION . '.';
}

if ($issues) {
Expand Down

0 comments on commit 4d62d71

Please sign in to comment.