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

Commit 4d62d71

Browse files
authored
Merge pull request #279 from wp-graphql/feature/#275-generate-schema-artifact
Generate Schema Artifact
2 parents f34bb96 + 58d25e3 commit 4d62d71

12 files changed

+51
-49
lines changed

.env.dist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ ADMIN_PATH=/wp-admin
1212

1313
TEST_DB_NAME=wpgraphql_acf_tests
1414
TEST_DB_HOST=127.0.0.1
15-
TEST_DB_USER=wordpress
16-
TEST_DB_PASSWORD=wordpress
15+
TEST_DB_USER=root
16+
TEST_DB_PASSWORD=root
1717
TEST_WP_TABLE_PREFIX=wp_
1818

1919
SKIP_DB_CREATE=false

.github/workflows/upload-schema-artifact.yml

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
1-
name: Schema Artifact
1+
name: Upload Schema Artifact
22

33
on:
4-
workflow_dispatch:
5-
push:
6-
branches:
7-
- develop
8-
- master
9-
pull_request:
10-
branches:
11-
- develop
12-
- master
4+
release:
5+
types: [ published ]
136

147
jobs:
158
run:
@@ -42,21 +35,18 @@ jobs:
4235
4336
- name: Install WP CLI for ACF
4437
run: |
45-
cd /tmp/wordpress/
46-
wp plugin install https://github.com/hoppinger/advanced-custom-fields-wpcli/archive/refs/heads/master.zip --activate
38+
wp plugin install https://github.com/hoppinger/advanced-custom-fields-wpcli/archive/refs/heads/master.zip --activate --path="/tmp/wordpress"
4739
- name: Import test Field Group
4840
run: |
49-
echo ${GITHUB_WORKSPACE}/docs/field-group-examples-export.json
50-
wp acf import --json_file="${GITHUB_WORKSPACE}/docs/field-group-examples-export.json"
41+
wp acf import --json_file="${GITHUB_WORKSPACE}/docs/field-group-examples-export.json" --path="/tmp/wordpress"
5142
- name: Generate the Static Schema
5243
run: |
5344
cd /tmp/wordpress/
5445
# Output: /tmp/schema.graphql
5546
wp graphql generate-static-schema
56-
echo "$(</tmp/schema.graphql )"
57-
# - name: Upload schema as release artifact
58-
# uses: softprops/action-gh-release@v1
59-
# with:
60-
# files: /tmp/schema.graphql
61-
# env:
62-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
- name: Upload schema as release artifact
48+
uses: softprops/action-gh-release@v1
49+
with:
50+
files: /tmp/schema.graphql
51+
env:
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ vendor/composer/installed.json
1717
vendor/composer/*/
1818
composer.lock
1919
.log
20+
local
21+
wp-content
22+

bin/install-test-env.sh

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
#!/usr/bin/env bash
22

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

9-
source .env.dist
10-
11-
env | sort
10+
source .env
1211

1312
print_usage_instruction() {
1413
echo "Ensure that .env file exist in project root directory exists."
@@ -140,8 +139,6 @@ install_db() {
140139
fi
141140
fi
142141

143-
env | sort
144-
145142
# create database
146143
RESULT=`mysql -u $DB_USER --password="$DB_PASS" --skip-column-names -e "SHOW DATABASES LIKE '$DB_NAME'"$EXTRA`
147144
if [ "$RESULT" != $DB_NAME ]; then

bin/run-docker.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,17 @@ if [ -z "$1" ]; then
2121
print_usage_instructions
2222
fi
2323

24-
BUILD_NO_CACHE=
24+
TAG=${TAG-latest}
25+
WP_VERSION=${WP_VERSION-5.6}
26+
PHP_VERSION=${PHP_VERSION-7.4}
27+
28+
BUILD_NO_CACHE=${BUILD_NO_CACHE-}
29+
30+
if [[ ! -f ".env" ]]; then
31+
echo "No .env file was detected. .env.dist has been copied to .env"
32+
echo "Open the .env file and enter values to match your local environment"
33+
cp .env.dist .env
34+
fi
2535

2636
subcommand=$1; shift
2737
case "$subcommand" in

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"phpstan": ["phpstan analyze --ansi --memory-limit=1G"]
4646
},
4747
"require": {
48-
"php": "^7"
48+
"php": "^7.1 || ^8.0"
4949
},
5050
"require-dev": {
5151
"lucatume/wp-browser": "^2.4",

docker/app.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ RUN curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli
4747
# Set project environmental variables
4848
ENV WP_ROOT_FOLDER="/var/www/html"
4949
ENV PLUGINS_DIR="${WP_ROOT_FOLDER}/wp-content/plugins"
50-
ENV PROJECT_DIR="${PLUGINS_DIR}/wp-graphql"
50+
ENV PROJECT_DIR="${PLUGINS_DIR}/wp-graphql-acf"
5151
ENV DATA_DUMP_DIR="${PROJECT_DIR}/tests/_data"
5252

5353
# Remove exec statement from base entrypoint script.

docker/app.post-setup.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/bin/bash
22

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

68
# Set pretty permalinks.
79
wp rewrite structure '/%year%/%monthnum%/%postname%/' --allow-root

docker/testing.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
ARG WP_VERSION
66
ARG PHP_VERSION
77

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

1010
LABEL author=jasonbahl
1111
LABEL author_uri=https://github.com/jasonbahl

vendor/composer/InstalledVersions.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,24 @@ class InstalledVersions
2525
private static $installed = array (
2626
'root' =>
2727
array (
28-
'pretty_version' => 'dev-master',
29-
'version' => 'dev-master',
28+
'pretty_version' => 'dev-develop',
29+
'version' => 'dev-develop',
3030
'aliases' =>
3131
array (
3232
),
33-
'reference' => 'dc5e83d190211baf88978a905ff44a9122fdaff8',
33+
'reference' => 'f34bb96ba52af54541439299b04e2b95d4f7564a',
3434
'name' => 'wp-graphql/wp-graphql-acf',
3535
),
3636
'versions' =>
3737
array (
3838
'wp-graphql/wp-graphql-acf' =>
3939
array (
40-
'pretty_version' => 'dev-master',
41-
'version' => 'dev-master',
40+
'pretty_version' => 'dev-develop',
41+
'version' => 'dev-develop',
4242
'aliases' =>
4343
array (
4444
),
45-
'reference' => 'dc5e83d190211baf88978a905ff44a9122fdaff8',
45+
'reference' => 'f34bb96ba52af54541439299b04e2b95d4f7564a',
4646
),
4747
),
4848
);

vendor/composer/installed.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
<?php return array (
22
'root' =>
33
array (
4-
'pretty_version' => 'dev-master',
5-
'version' => 'dev-master',
4+
'pretty_version' => 'dev-develop',
5+
'version' => 'dev-develop',
66
'aliases' =>
77
array (
88
),
9-
'reference' => 'dc5e83d190211baf88978a905ff44a9122fdaff8',
9+
'reference' => 'f34bb96ba52af54541439299b04e2b95d4f7564a',
1010
'name' => 'wp-graphql/wp-graphql-acf',
1111
),
1212
'versions' =>
1313
array (
1414
'wp-graphql/wp-graphql-acf' =>
1515
array (
16-
'pretty_version' => 'dev-master',
17-
'version' => 'dev-master',
16+
'pretty_version' => 'dev-develop',
17+
'version' => 'dev-develop',
1818
'aliases' =>
1919
array (
2020
),
21-
'reference' => 'dc5e83d190211baf88978a905ff44a9122fdaff8',
21+
'reference' => 'f34bb96ba52af54541439299b04e2b95d4f7564a',
2222
),
2323
),
2424
);

vendor/composer/platform_check.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
$issues = array();
66

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

1111
if ($issues) {

0 commit comments

Comments
 (0)