diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0db93d8e1cd6..7ba461191714 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 }} @@ -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 diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 95ddb13c1d3f..613b792b44e4 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -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 @@ -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: diff --git a/docker-compose.yml b/docker-compose.yml index d085c3eec757..0f920f7fe9ce 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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: diff --git a/package.json b/package.json index a4fc2a764a72..21a765d7ab52 100644 --- a/package.json +++ b/package.json @@ -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",