Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI Speedup: skip optional install steps in tests #10231

Closed
wants to merge 12 commits into from
29 changes: 23 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,35 +40,50 @@ jobs:
- npm run ci || exit 1

- stage: test
env: WP_VERSION=latest DOCKER=true
env:
WP_VERSION=latest
DOCKER=true
SKIP_POSTINSTALL=true
script:
- ./bin/run-wp-unit-tests.sh

- stage: test
php: 5.6
env: WP_VERSION=latest
env:
WP_VERSION=latest
SKIP_POSTINSTALL=true
script:
- ./bin/run-wp-unit-tests.sh
if: branch = master and type != "pull_request"

- stage: test
php: 7.1
env: WP_VERSION=latest SWITCH_TO_PHP=5.3
env:
WP_VERSION=latest
SWITCH_TO_PHP=5.3
SKIP_POSTINSTALL=true
script:
- ./bin/run-wp-unit-tests.sh
if: branch = master and type != "pull_request"

- stage: test
php: 7.1
env: WP_VERSION=latest SWITCH_TO_PHP=5.2
env:
WP_VERSION=latest
SWITCH_TO_PHP=5.2
SKIP_POSTINSTALL=true
script:
- ./bin/run-wp-unit-tests.sh

- stage: test
env: WP_VERSION=latest
env:
WP_VERSION=latest
SKIP_POSTINSTALL=true
cache:
yarn: true
script:
- npm install || exit 1
- ./bin/run-e2e-tests.sh || exit 1

- stage: test
language: node_js
node_js: 8
Expand All @@ -82,6 +97,7 @@ jobs:
- cd ./gutenberg-mobile
- yarn install
- ./.travis/travis-checks-js.sh

- stage: test
language: node_js
node_js: 8
Expand All @@ -96,6 +112,7 @@ jobs:
- cd ./gutenberg-mobile
- yarn install
- ./.travis/travis-checks-js.sh

- stage: test
language: node_js
node_js: 8
Expand Down
2 changes: 1 addition & 1 deletion bin/install-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ docker-compose $DOCKER_COMPOSE_FILE_OPTIONS down --remove-orphans >/dev/null 2>&

# Download image updates.
echo -e $(status_message "Downloading Docker image updates...")
docker-compose $DOCKER_COMPOSE_FILE_OPTIONS pull
docker-compose $DOCKER_COMPOSE_FILE_OPTIONS pull --parallel

# Launch the containers.
echo -e $(status_message "Starting Docker containers...")
Expand Down
5 changes: 5 additions & 0 deletions bin/postinstall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

if [ "$SKIP_POSTINSTALL" != "true" ]; then
npm run mobile-install && npm run check-licenses && npm run build:packages
fi
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
"mobile-submodule-update": "git submodule update --init --recursive",
"mobile-install": "yarn --cwd gutenberg-mobile install",
"preinstall": "npm run mobile-submodule-update",
"postinstall": " npm run mobile-install && npm run check-licenses && npm run build:packages",
"postinstall": "./bin/postinstall.sh",
"pot-to-php": "./bin/pot-to-php.js",
"precommit": "lint-staged",
"publish:check": "npm run build:packages && lerna updated",
Expand Down