diff --git a/.docker/Dockerfile b/.docker/Dockerfile index 239394ef..5ae5d372 100644 --- a/.docker/Dockerfile +++ b/.docker/Dockerfile @@ -1,7 +1,7 @@ ARG WP_VERSION ARG PHP_VERSION -FROM wordpress:${WP_VERSION}-php${PHP_VERSION} +FROM wordpress:latest # Save the build args for use by the runtime environment ENV WP_VERSION=${WP_VERSION} @@ -17,6 +17,10 @@ RUN curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli && mv wp-cli.phar /usr/local/bin/wp \ && wp --info +RUN wp core update --version=${WP_VERSION} --force \ + && wp core update-db --force \ + && wp core version + RUN set -e \ ; apt-get -qq update \ ; apt-get install \ diff --git a/.github/workflows/test-plugin.yml b/.github/workflows/test-plugin.yml index 5a091c52..dda69ea2 100644 --- a/.github/workflows/test-plugin.yml +++ b/.github/workflows/test-plugin.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: php: [ '8.2', '7.4' ] - wordpress: [ '6.5', '6.4', '6.3', '6.2', '6.1' ] + wordpress: [ 'latest', '6.5', '6.4', '6.3', '6.2', '6.1' ] exclude: - php: 8.2 wordpress: 6.1 @@ -24,6 +24,8 @@ jobs: wordpress: 6.4 - php: 7.4 wordpress: 6.5 + - php: 7.4 + wordpress: 'latest' fail-fast: false name: WordPress ${{ matrix.wordpress }}, PHP ${{ matrix.php }} steps: @@ -49,7 +51,9 @@ jobs: - name: Setup testing framework working-directory: ./ - run: docker exec -e COVERAGE=1 $(docker-compose ps -q wordpress) init-testing-environment.sh + run: | + docker exec -e COVERAGE=1 $(docker-compose ps -q wordpress) init-testing-environment.sh + docker exec --workdir=/var/www/html/wp-content/plugins/wp-graphql-content-blocks $(docker-compose ps -q wordpress) wp core version --allow-root - name: Install and activate WP GraphQL working-directory: ./ diff --git a/bin/_lib.sh b/bin/_lib.sh index 7bd66e66..e11d70e2 100644 --- a/bin/_lib.sh +++ b/bin/_lib.sh @@ -12,7 +12,7 @@ download() { } install_wordpress() { - + if [ -d $WP_CORE_DIR ]; then return; fi @@ -113,7 +113,7 @@ configure_wordpress() { echo "Setting up WordPress..." export WP_CLI_CONFIG_PATH=${WP_CLI_CONFIG_PATH}; - + wp config create --dbname="$DB_NAME" --dbuser="$DB_USER" --dbpass="$DB_PASS" --dbhost="$DB_HOST" --skip-check --force=true wp core install --url=$WP_DOMAIN --title=Test --admin_user=$ADMIN_USERNAME --admin_password=$ADMIN_PASSWORD --admin_email=$ADMIN_EMAIL wp rewrite structure '/%year%/%monthnum%/%postname%/' --hard