Skip to content

Commit

Permalink
CI/CD: Attempt to fix e2e test env (#1751)
Browse files Browse the repository at this point in the history
* CI/CD: Attempt to fix env

* Step:Init testing
  • Loading branch information
theodesp authored Jan 24, 2024
1 parent afe03b8 commit 37be1fe
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/e2e-test-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ jobs:
- name: Maybe upgrade WP DB
working-directory: plugins/faustwp
run: docker exec --workdir=/var/www/html/wp-content/plugins/faustwp $(docker-compose ps -q wordpress) wp core update-db --allow-root
- name: Init Testing Environment
working-directory: plugins/faustwp
run: docker exec --workdir=/var/www/html/wp-content/plugins/faustwp $(docker-compose ps -q wordpress) init-testing-environment.sh
- name: Install WP GraphQL
working-directory: plugins/faustwp
run: |
Expand Down
6 changes: 6 additions & 0 deletions plugins/faustwp/.docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ ENV WP_VERSION=${WP_VERSION}
# Needed for Codeception WPDB test integration.
RUN docker-php-ext-install pdo pdo_mysql

# Install Dockerize
ENV DOCKERIZE_VERSION v0.7.0
RUN curl -L -O https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz

# Install WP cli
RUN curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar \
&& chmod +x wp-cli.phar \
Expand Down
3 changes: 3 additions & 0 deletions plugins/faustwp/.docker/scripts/init-testing-environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ version_gt() {
test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1";
}

# Ensure mysql is loaded
dockerize -wait tcp://${WORDPRESS_DB_HOST}:3306 -timeout 1m

cd /var/www/html/wp-content/plugins/$WP_PLUGIN_FOLDER

# Setup WordPress test core files and database
Expand Down

0 comments on commit 37be1fe

Please sign in to comment.