Skip to content

Commit

Permalink
Merge pull request wp-graphql#220 from jasonbahl/feature/ci-tests
Browse files Browse the repository at this point in the history
Update test environment
  • Loading branch information
jasonbahl authored Feb 26, 2021
2 parents 9ce43e6 + be92ebc commit c9383e5
Show file tree
Hide file tree
Showing 16 changed files with 50 additions and 21,244 deletions.
3 changes: 3 additions & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
service_name: travis-ci
coverage_clover: tests/_output/coverage.xml
json_path: tests/_output/coveralls-upload.json
46 changes: 0 additions & 46 deletions .github/workflows/code-quality.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/testing-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: json, mbstring
extensions: json, mbstring, zip, unzip

- name: Get Composer Cache Directory
id: composercache
Expand All @@ -58,7 +58,7 @@ jobs:
restore-keys: ${{ runner.os }}-composer-

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

- name: Build "testing" Docker Image
env:
Expand Down
6 changes: 5 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"email": "jasonbahl@mac.com"
}],
"config": {
"optimize-autoloader": true
"optimize-autoloader": true,
"process-timeout": 0
},
"autoload": {
"psr-4": {
Expand Down Expand Up @@ -43,6 +44,9 @@
],
"phpstan": ["phpstan analyze --ansi --memory-limit=1G"]
},
"require": {
"php": "^7"
},
"require-dev": {
"lucatume/wp-browser": "^2.4",
"codeception/module-asserts": "^1.0",
Expand Down
4 changes: 2 additions & 2 deletions docker/app.entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ fi
# Install and activate ACF Pro
if [ ! -f "${PLUGINS_DIR}/advanced-custom-fields-pro/acf.php" ]; then
wp plugin install \
https://github.com/wp-premium/advanced-custom-fields-pro/archive/${CORE_BRANCH-master}.zip \
https://github.com/wp-premium/advanced-custom-fields-pro/archive/master.zip \
--activate --allow-root
else
wp plugin activate advanced-custom-fields-pro --allow-root
fi

# Install and activate WPGraphQL ACF
# Install and activate WPGatsby
wp plugin activate wp-graphql-acf --allow-root

# Set pretty permalinks.
Expand Down
20 changes: 19 additions & 1 deletion docker/testing.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
############################################################################
# Container for running Codeception tests on a WooGraphQL Docker instance. #
# Container for running Codeception tests on a WPGraphQL Docker instance. #
############################################################################

# Using the 'DESIRED_' prefix to avoid confusion with environment variables of the same name.
Expand All @@ -11,12 +11,28 @@ LABEL author_uri=https://github.com/jasonbahl
SHELL [ "/bin/bash", "-c" ]

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

# Install php extensions
RUN docker-php-ext-install pdo_mysql

# Install PCOV and XDebug
# This is needed for Codeception / PHPUnit to track code coverage
RUN if [[ "$USING_XDEBUG" ]]; then \
apt-get install zip unzip -y && \
pecl install pcov && \
docker-php-ext-enable pcov && \
rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && \
echo "pcov.enabled=1" >> /usr/local/etc/php/php.ini ;\
yes | pecl install xdebug \
&& 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; \
fi

# Install composer
ENV COMPOSER_ALLOW_SUPERUSER=1

Expand All @@ -27,6 +43,8 @@ RUN curl -sS https://getcomposer.org/installer | php -- \
# Add composer global binaries to PATH
ENV PATH "$PATH:~/.composer/vendor/bin"



# Configure php
RUN echo "date.timezone = UTC" >> /usr/local/etc/php/php.ini

Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Donate link: https://wpgraphql.com/acf
Tags: WPGraphQL, GraphQL, API, Advanced Custom Fields, ACF
Requires at least: 5.0
Tested up to: 5.1.1
Stable tag: 0.4.1
Stable tag: 0.5.0
License: GPL-3
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Expand Down
Loading

0 comments on commit c9383e5

Please sign in to comment.