-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to using the Core local environment (#17004)
- Loading branch information
Showing
42 changed files
with
928 additions
and
1,090 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,6 @@ gutenberg.zip | |
*.log | ||
phpcs.xml | ||
yarn.lock | ||
docker-compose.override.yml | ||
/wordpress | ||
|
||
playground/dist | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,16 +16,79 @@ cache: | |
- $HOME/.jest-cache | ||
- $HOME/.npm | ||
- $HOME/.nvm/.cache | ||
- $HOME/.phpbrew | ||
|
||
branches: | ||
only: | ||
- master | ||
|
||
env: | ||
global: | ||
- PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true | ||
- WP_DEVELOP_DIR: ./wordpress | ||
- LOCAL_SCRIPT_DEBUG: false | ||
- INSTALL_COMPOSER: false | ||
- INSTALL_WORDPRESS: true | ||
|
||
before_install: | ||
- nvm install | ||
|
||
env: PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true | ||
- | | ||
if [[ "$INSTALL_WORDPRESS" = "true" ]]; then | ||
# Upgrade docker-compose. | ||
sudo rm /usr/local/bin/docker-compose | ||
curl -sL https://github.com/docker/compose/releases/download/1.24.0/docker-compose-`uname -s`-`uname -m` > docker-compose | ||
chmod +x docker-compose | ||
sudo mv docker-compose /usr/local/bin | ||
fi | ||
install: | ||
# Build Gutenberg. | ||
- npm ci | ||
- npm run build | ||
- | | ||
if [[ "$INSTALL_WORDPRESS" = "true" ]]; then | ||
# Download and unpack WordPress. | ||
curl -sL https://wordpress.org/nightly-builds/wordpress-latest.zip -o /tmp/wordpress-latest.zip | ||
unzip -q /tmp/wordpress-latest.zip -d /tmp | ||
mkdir -p wordpress/src | ||
mv /tmp/wordpress/* wordpress/src | ||
# Create the upload directory with permissions that Travis can handle. | ||
mkdir -p wordpress/src/wp-content/uploads | ||
chmod 767 wordpress/src/wp-content/uploads | ||
# Grab the tools we need for WordPress' local-env. | ||
curl -sL https://github.com/WordPress/wordpress-develop/archive/master.zip -o /tmp/wordpress-develop.zip | ||
unzip -q /tmp/wordpress-develop.zip -d /tmp | ||
mv \ | ||
/tmp/wordpress-develop-master/tools \ | ||
/tmp/wordpress-develop-master/tests \ | ||
/tmp/wordpress-develop-master/.env \ | ||
/tmp/wordpress-develop-master/docker-compose.yml \ | ||
/tmp/wordpress-develop-master/wp-cli.yml \ | ||
/tmp/wordpress-develop-master/*config-sample.php \ | ||
/tmp/wordpress-develop-master/package.json wordpress | ||
# Install WordPress. | ||
cd wordpress | ||
npm install dotenv wait-on | ||
npm run env:start | ||
sleep 10 | ||
npm run env:install | ||
cd .. | ||
# Connect Gutenberg to WordPress. | ||
npm run env connect | ||
npm run env cli plugin activate gutenberg | ||
fi | ||
- | | ||
if [[ "$INSTALL_COMPOSER" = "true" ]]; then | ||
npm run env docker-run -- php composer install | ||
fi | ||
- | | ||
if [[ "$E2E_ROLE" = "author" ]]; then | ||
npm run env cli -- user create author [email protected] --role=author --user_pass=authpass | ||
npm run env cli -- post update 1 --post_author=2 | ||
fi | ||
jobs: | ||
include: | ||
|
@@ -52,125 +115,86 @@ jobs: | |
- npm run check-licenses | ||
|
||
- name: JavaScript unit tests | ||
env: INSTALL_WORDPRESS=false | ||
install: | ||
- npm ci | ||
script: | ||
# It's not necessary to run the full build, since Jest can interpret | ||
# source files with `babel-jest`. Some packages have their own custom | ||
# build tasks, however. These must be run. | ||
- npx lerna run build | ||
script: | ||
- npm run test-unit -- --ci --maxWorkers=2 --cacheDirectory="$HOME/.jest-cache" | ||
|
||
- name: JavaScript native mobile tests | ||
install: | ||
- npm ci | ||
script: | ||
# It's not necessary to run the full build, since Jest can interpret | ||
# source files with `babel-jest`. Some packages have their own custom | ||
# build tasks, however. These must be run. | ||
- npx lerna run build | ||
script: | ||
- npm run test-unit:native -- --ci --maxWorkers=2 --cacheDirectory="$HOME/.jest-cache" | ||
|
||
- name: PHP unit tests (Docker) | ||
env: WP_VERSION=latest DOCKER=true | ||
- name: PHP unit tests | ||
env: INSTALL_COMPOSER=true | ||
script: | ||
- ./bin/run-wp-unit-tests.sh | ||
- npm run test-php && npm run test-unit-php-multisite | ||
|
||
- name: PHP unit tests (PHP 5.6) | ||
language: php | ||
php: 5.6 | ||
env: WP_VERSION=latest | ||
env: INSTALL_COMPOSER=true LOCAL_PHP=5.6-fpm | ||
script: | ||
- ./bin/run-wp-unit-tests.sh | ||
if: branch = master and type != "pull_request" | ||
|
||
- name: PHP unit tests (PHP 5.3) | ||
env: WP_VERSION=latest SWITCH_TO_PHP=5.3 | ||
script: | ||
- ./bin/run-wp-unit-tests.sh | ||
if: branch = master and type != "pull_request" | ||
|
||
- name: PHP unit tests (PHP 5.2) | ||
env: WP_VERSION=latest SWITCH_TO_PHP=5.2 | ||
script: | ||
- ./bin/run-wp-unit-tests.sh | ||
- npm run test-php && npm run test-unit-php-multisite | ||
|
||
- name: E2E tests (Admin) (1/4) | ||
env: WP_VERSION=latest SCRIPT_DEBUG=false PUPPETEER_SKIP_CHROMIUM_DOWNLOAD= | ||
install: | ||
- ./bin/setup-travis-e2e-tests.sh | ||
env: FORCE_REDUCED_MOTION=true PUPPETEER_SKIP_CHROMIUM_DOWNLOAD= | ||
script: | ||
- $( npm bin )/wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --listTests > ~/.jest-e2e-tests | ||
- $( npm bin )/wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --cacheDirectory="$HOME/.jest-cache" --runTestsByPath $( awk 'NR % 4 == 0' < ~/.jest-e2e-tests ) | ||
|
||
- name: E2E tests (Admin) (2/4) | ||
env: WP_VERSION=latest SCRIPT_DEBUG=false PUPPETEER_SKIP_CHROMIUM_DOWNLOAD= | ||
install: | ||
- ./bin/setup-travis-e2e-tests.sh | ||
env: FORCE_REDUCED_MOTION=true PUPPETEER_SKIP_CHROMIUM_DOWNLOAD= | ||
script: | ||
- $( npm bin )/wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --listTests > ~/.jest-e2e-tests | ||
- $( npm bin )/wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --cacheDirectory="$HOME/.jest-cache" --runTestsByPath $( awk 'NR % 4 == 1' < ~/.jest-e2e-tests ) | ||
|
||
- name: E2E tests (Admin) (3/4) | ||
env: WP_VERSION=latest SCRIPT_DEBUG=false PUPPETEER_SKIP_CHROMIUM_DOWNLOAD= | ||
install: | ||
- ./bin/setup-travis-e2e-tests.sh | ||
env: FORCE_REDUCED_MOTION=true PUPPETEER_SKIP_CHROMIUM_DOWNLOAD= | ||
script: | ||
- $( npm bin )/wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --listTests > ~/.jest-e2e-tests | ||
- $( npm bin )/wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --cacheDirectory="$HOME/.jest-cache" --runTestsByPath $( awk 'NR % 4 == 2' < ~/.jest-e2e-tests ) | ||
|
||
- name: E2E tests (Admin) (4/4) | ||
env: WP_VERSION=latest SCRIPT_DEBUG=false PUPPETEER_SKIP_CHROMIUM_DOWNLOAD= | ||
install: | ||
- ./bin/setup-travis-e2e-tests.sh | ||
env: FORCE_REDUCED_MOTION=true PUPPETEER_SKIP_CHROMIUM_DOWNLOAD= | ||
script: | ||
- $( npm bin )/wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --listTests > ~/.jest-e2e-tests | ||
- $( npm bin )/wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --cacheDirectory="$HOME/.jest-cache" --runTestsByPath $( awk 'NR % 4 == 3' < ~/.jest-e2e-tests ) | ||
|
||
- name: E2E tests (Author) (1/4) | ||
env: WP_VERSION=latest SCRIPT_DEBUG=false E2E_ROLE=author PUPPETEER_SKIP_CHROMIUM_DOWNLOAD= | ||
install: | ||
- ./bin/setup-travis-e2e-tests.sh | ||
env: E2E_ROLE=author FORCE_REDUCED_MOTION=true PUPPETEER_SKIP_CHROMIUM_DOWNLOAD= | ||
script: | ||
- $( npm bin )/wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --listTests > ~/.jest-e2e-tests | ||
- $( npm bin )/wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --cacheDirectory="$HOME/.jest-cache" --runTestsByPath $( awk 'NR % 4 == 0' < ~/.jest-e2e-tests ) | ||
|
||
- name: E2E tests (Author) (2/4) | ||
env: WP_VERSION=latest SCRIPT_DEBUG=false E2E_ROLE=author PUPPETEER_SKIP_CHROMIUM_DOWNLOAD= | ||
install: | ||
- ./bin/setup-travis-e2e-tests.sh | ||
env: E2E_ROLE=author FORCE_REDUCED_MOTION=true PUPPETEER_SKIP_CHROMIUM_DOWNLOAD= | ||
script: | ||
- $( npm bin )/wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --listTests > ~/.jest-e2e-tests | ||
- $( npm bin )/wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --cacheDirectory="$HOME/.jest-cache" --runTestsByPath $( awk 'NR % 4 == 1' < ~/.jest-e2e-tests ) | ||
|
||
- name: E2E tests (Author) (3/4) | ||
env: WP_VERSION=latest SCRIPT_DEBUG=false E2E_ROLE=author PUPPETEER_SKIP_CHROMIUM_DOWNLOAD= | ||
install: | ||
- ./bin/setup-travis-e2e-tests.sh | ||
env: E2E_ROLE=author FORCE_REDUCED_MOTION=true PUPPETEER_SKIP_CHROMIUM_DOWNLOAD= | ||
script: | ||
- $( npm bin )/wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --listTests > ~/.jest-e2e-tests | ||
- $( npm bin )/wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --cacheDirectory="$HOME/.jest-cache" --runTestsByPath $( awk 'NR % 4 == 2' < ~/.jest-e2e-tests ) | ||
|
||
- name: E2E tests (Author) (4/4) | ||
env: WP_VERSION=latest SCRIPT_DEBUG=false E2E_ROLE=author PUPPETEER_SKIP_CHROMIUM_DOWNLOAD= | ||
install: | ||
- ./bin/setup-travis-e2e-tests.sh | ||
env: E2E_ROLE=author FORCE_REDUCED_MOTION=true PUPPETEER_SKIP_CHROMIUM_DOWNLOAD= | ||
script: | ||
- $( npm bin )/wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --listTests > ~/.jest-e2e-tests | ||
- $( npm bin )/wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --cacheDirectory="$HOME/.jest-cache" --runTestsByPath $( awk 'NR % 4 == 3' < ~/.jest-e2e-tests ) | ||
|
||
allow_failures: | ||
- name: JavaScript native mobile tests | ||
- name: PHP unit tests (PHP 5.3) | ||
env: WP_VERSION=latest SWITCH_TO_PHP=5.3 | ||
script: | ||
- ./bin/run-wp-unit-tests.sh | ||
if: branch = master and type != "pull_request" | ||
|
||
- name: PHP unit tests (PHP 5.2) | ||
env: WP_VERSION=latest SWITCH_TO_PHP=5.2 | ||
script: | ||
- ./bin/run-wp-unit-tests.sh | ||
|
||
before_deploy: | ||
- npm install | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
services: | ||
wordpress-develop: | ||
volumes: | ||
- %PLUGIN_MOUNT_DIR%:/var/www/${LOCAL_DIR-src}/wp-content/plugins/%PLUGIN_INSTALL_DIR% | ||
- %PLUGIN_MOUNT_DIR%/packages/e2e-tests/plugins:/var/www/${LOCAL_DIR-src}/wp-content/plugins/gutenberg-test-plugins | ||
- %PLUGIN_MOUNT_DIR%/packages/e2e-tests/mu-plugins:/var/www/${LOCAL_DIR-src}/wp-content/mu-plugins | ||
php: | ||
volumes: | ||
- %PLUGIN_MOUNT_DIR%:/var/www/${LOCAL_DIR-src}/wp-content/plugins/%PLUGIN_INSTALL_DIR% | ||
- %PLUGIN_MOUNT_DIR%/packages/e2e-tests/plugins:/var/www/${LOCAL_DIR-src}/wp-content/plugins/gutenberg-test-plugins | ||
- %PLUGIN_MOUNT_DIR%/packages/e2e-tests/mu-plugins:/var/www/${LOCAL_DIR-src}/wp-content/mu-plugins | ||
cli: | ||
volumes: | ||
- %PLUGIN_MOUNT_DIR%:/var/www/${LOCAL_DIR-src}/wp-content/plugins/%PLUGIN_INSTALL_DIR% | ||
phpunit: | ||
volumes: | ||
- %PLUGIN_MOUNT_DIR%:/var/www/${LOCAL_DIR-src}/wp-content/plugins/%PLUGIN_INSTALL_DIR% |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.