From 7e9132f833136c791394c731a0adab965edb1273 Mon Sep 17 00:00:00 2001 From: Andrew Duthie Date: Fri, 26 Apr 2019 15:07:08 -0400 Subject: [PATCH 1/3] Build Tooling: Split JavaScript tasks to individual jobs --- .travis.yml | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index e1a21e3f72cc5..fa5cf0893c2f2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,17 +27,28 @@ before_install: jobs: include: - - name: JS unit tests - env: WP_VERSION=latest + - name: Lint before_install: - nvm install --latest-npm - install: - - npm ci script: - - npm run build - npm run lint + + - name: Build artifacts + before_install: + - nvm install --latest-npm + script: - npm run check-local-changes + + - name: License compatibility + before_install: + - nvm install --latest-npm + script: - npm run check-licenses + + - name: JavaScript unit tests + before_install: + - nvm install --latest-npm + script: - npm run test-unit -- --ci --maxWorkers=2 --cacheDirectory="$HOME/.jest-cache" - name: PHP unit tests (Docker) From b6b77dc9eb0658d559f2f980e05db57286e9ed19 Mon Sep 17 00:00:00 2001 From: Andrew Duthie Date: Fri, 26 Apr 2019 15:38:07 -0400 Subject: [PATCH 2/3] Build Tooling: Reintroduce install script I thought it redundant. Alas, I was wrong --- .travis.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.travis.yml b/.travis.yml index fa5cf0893c2f2..e26fedc7ae209 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,24 +30,32 @@ jobs: - name: Lint before_install: - nvm install --latest-npm + install: + - npm ci script: - npm run lint - name: Build artifacts before_install: - nvm install --latest-npm + install: + - npm ci script: - npm run check-local-changes - name: License compatibility before_install: - nvm install --latest-npm + install: + - npm ci script: - npm run check-licenses - name: JavaScript unit tests before_install: - nvm install --latest-npm + install: + - npm ci script: - npm run test-unit -- --ci --maxWorkers=2 --cacheDirectory="$HOME/.jest-cache" From 00358d8c790d202baa19c8e1ab04739d7a052f2d Mon Sep 17 00:00:00 2001 From: Andrew Duthie Date: Wed, 8 May 2019 17:04:46 -0400 Subject: [PATCH 3/3] Build Tooling: Run packages custom build script in unit tests --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index e26fedc7ae209..9458a12f6e41e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -57,6 +57,10 @@ jobs: 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 - npm run test-unit -- --ci --maxWorkers=2 --cacheDirectory="$HOME/.jest-cache" - name: PHP unit tests (Docker)