Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
build-plugin:
name: Build plugin
runs-on: ubuntu-22.04
if: startsWith( github.repository, 'elementor/' )
# if: startsWith( github.repository, 'elementor/' )
outputs:
artifact_name: ${{ env.PLUGIN_FOLDER_FILENAME}}
changelog_diff: ${{ steps.changelog_diff_files.outputs.diff }}
Expand Down Expand Up @@ -76,7 +76,6 @@ jobs:

echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV
echo "PLUGIN_FOLDER_FILENAME=$PLUGIN_FOLDER_FILENAME" >> $GITHUB_ENV

- name: Build plugin
if: github.event.pull_request.title == null || steps.changelog_diff_files.outputs.diff
uses: ./.github/workflows/build-plugin
Expand Down
18 changes: 17 additions & 1 deletion .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,25 @@ jobs:
PHP_VERSION: '8.0'
WP_CORE_VERSION: 'latest'
run: node ./.github/scripts/build-wp-env.js
- name: Install Docker Compose
run: |
sudo apt-get update
sudo apt-get install -y docker-compose
- name: Check Docker Compose Version
run: docker compose version
- name: Install WordPress environment
run: |
npm run start-local-server
- name: Wait for services to start
run: sleep 30
- name: Run WP-CLI Command
run: |
docker compose run wpcli wp core install \
--url="http://localhost:8888" \
--title="My WordPress Site" \
--admin_user="admin" \
--admin_password="adminpassword" \
--admin_email="admin@example.com"
- name: Update wordpress to nightly build
if: ${{ github.event_name == 'schedule' }}
run: npx wp-env run cli wp core update https://wordpress.org/nightly-builds/wordpress-latest.zip
Expand Down Expand Up @@ -165,7 +181,7 @@ jobs:

test-result:
needs: Playwright
if: ${{ always() }} # Will be run even if 'Playwright' matrix will be skipped
# if: ${{ always() }} # Will be run even if 'Playwright' matrix will be skipped
runs-on: ubuntu-22.04
name: Playwright - Test Results
steps:
Expand Down
72 changes: 59 additions & 13 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,70 @@
version: '3.1'
version: '3.9'

services:
# Database
db:
image: mysql:8.0
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
networks:
- wpsite

mysql:
image: mysql:5.7
# phpMyAdmin
phpmyadmin:
depends_on:
- db
image: phpmyadmin:latest
restart: always
ports:
- 3308:3306
- '8081:80'
environment:
PMA_HOST: db
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: wordpress_test
networks:
- wpsite

wordpress_phpunit:
image: pojome/phpunit-local
environment:
PHPUNIT_DB_HOST: mysql
# WordPress
wordpress:
depends_on:
- db
image: wordpress:latest
ports:
- '8888:80'
restart: always
volumes:
- .:/app
- testsuite:/tmp
- ./wordpress:/var/www/html
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
networks:
- wpsite

wpcli:
depends_on:
- mysql
- db
- wordpress
image: wordpress:cli
links:
- db:db
entrypoint: tail -f /dev/null
container_name: ${COMPOSE_PROJECT_NAME}_wpcli
volumes:
- ${WORDPRESS_DATA_DIR:-./wordpress}:/var/www/html
working_dir: /var/www/html
command:
-


networks:
wpsite:


volumes:
testsuite:
db_data:
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@
"test:linux": "node ./run-on-linux.js",
"build": "composer install --optimize-autoloader --prefer-dist && composer install --no-scripts --no-dev && composer dump-autoload && grunt build",
"setup-templates": "rm -rf ./templates && mkdir -p ./templates/playwright && mkdir -p ./templates/lighthouse && cp ./tests/playwright/templates/* ./templates/playwright && cp ./tests/lighthouse/templates/* ./templates/lighthouse",
"start-local-server": "npm run setup-templates && wp-env start",
"start-local-server": "npm run setup-templates && docker-compose up -d docker ps",
"test:php": "docker-compose run --rm wordpress_phpunit phpunit",
"test:php_multisite": "docker-compose run -e WP_MULTISITE=1 --rm wordpress_phpunit phpunit",
"test:setup:playwright": "wp-env run cli bash elementor-config/setup.sh && wp-env run tests-cli bash elementor-config/setup.sh",
"test:playwright": "playwright test -c tests/playwright/playwright.config.ts",
"test:playwright:debug": "npm run test:playwright -- --debug",
"test:playwright:debug": "npm run test:playwright -- --debug",
"test:playwright:elements-regression": "playwright test -c tests/elements-regression/playwright.config.ts",
"test:playwright:elements-regression:linux": "node ./tests/elements-regression/scripts/run-on-linux.js",
"test:playwright:elements-regression:linux:update-snapshots": "npm run test:playwright:elements-regression:linux -- -u",
Expand Down