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

[WIP] Improve Travis CI build times #13122

Closed
wants to merge 3 commits into from
Closed
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
1 change: 1 addition & 0 deletions .checksum
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
72208ee53c4681d45961928c311bfbdf
66 changes: 47 additions & 19 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dist: trusty

language: php
language: generic

services:
- docker
Expand All @@ -13,56 +13,84 @@ notifications:
cache:
directories:
- $HOME/.composer/cache
- $HOME/.phpbrew
- $HOME/.jest-cache
- $HOME/.npm

before_install:
- nvm install && nvm use
- npm install npm -g
- $HOME/.nvm/.cache
- $HOME/.phpbrew

branches:
only:
- master

before_install:
- nvm install

jobs:
include:
- stage: test
- name: JS unit tests
env: WP_VERSION=latest
before_install:
- nvm install --latest-npm
install:
- npm ci
script:
- npm install || exit 1
- npm run ci || exit 1
- echo $(composer config cache-dir)
- npm run lint
- npm run check-local-changes
- npm run test-unit -- --ci --maxWorkers=2 --cacheDirectory="$HOME/.jest-cache"

- stage: test
- name: PHP unit tests (Docker)
env: WP_VERSION=latest DOCKER=true
script:
- ./bin/run-wp-unit-tests.sh

- stage: test
- name: PHP unit tests (PHP 5.6)
language: php
php: 5.6
env: WP_VERSION=latest
script:
- ./bin/run-wp-unit-tests.sh
if: branch = master and type != "pull_request"

- stage: test
php: 7.1
- 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"

- stage: test
php: 7.1
- name: PHP unit tests (PHP 5.2)
env: WP_VERSION=latest SWITCH_TO_PHP=5.2
script:
- ./bin/run-wp-unit-tests.sh

- stage: test
- name: E2E tests (Admin with plugins) (1/2)
env: WP_VERSION=latest POPULAR_PLUGINS=true
install:
- ./bin/setup-local-env.sh
script:
- $( npm bin )/jest --config test/e2e/jest.config.json --listTests > ~/.jest-e2e-tests
- npm run test-e2e -- $( awk 'NR % 2 == 0' < ~/.jest-e2e-tests )

- name: E2E tests (Admin with plugins) (2/2)
env: WP_VERSION=latest POPULAR_PLUGINS=true
install:
- ./bin/setup-local-env.sh
script:
- $( npm bin )/jest --config test/e2e/jest.config.json --listTests > ~/.jest-e2e-tests
- npm run test-e2e -- $( awk 'NR % 2 == 1' < ~/.jest-e2e-tests )

- name: E2E tests (Author without plugins) (1/2)
env: WP_VERSION=latest E2E_ROLE=author
install:
- ./bin/setup-local-env.sh
script:
- ./bin/run-e2e-tests.sh || exit 1
- $( npm bin )/jest --config test/e2e/jest.config.json --listTests > ~/.jest-e2e-tests
- npm run test-e2e -- $( awk 'NR % 2 == 0' < ~/.jest-e2e-tests )

- stage: test
- name: E2E tests (Author without plugins) (2/2)
env: WP_VERSION=latest E2E_ROLE=author
install:
- ./bin/setup-local-env.sh
script:
- ./bin/run-e2e-tests.sh || exit 1
- $( npm bin )/jest --config test/e2e/jest.config.json --listTests > ~/.jest-e2e-tests
- npm run test-e2e -- $( awk 'NR % 2 == 1' < ~/.jest-e2e-tests )