Skip to content

Commit

Permalink
Separate PR jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
estherkim committed Feb 14, 2019
1 parent 84177fd commit cb95582
Show file tree
Hide file tree
Showing 14 changed files with 786 additions and 468 deletions.
114 changes: 65 additions & 49 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: node_js
sudo: required # See http://docs.travis-ci.com/user/trusty-ci-environment/
sudo: false
dist: trusty
node_js:
- "lts/*"
Expand All @@ -14,71 +14,87 @@ notifications:
webhooks:
- http://savage.nonblocking.io:8080/savage/travis
before_install:
- export CHROME_BIN=google-chrome-stable
- export DISPLAY=:99.0
- unset _JAVA_OPTIONS # JVM heap sizes break closure compiler. #11203.
- sh -e /etc/init.d/xvfb start
#- export CHROME_BIN=google-chrome-stable
#- export DISPLAY=:99.0
#- unset _JAVA_OPTIONS # JVM heap sizes break closure compiler. #11203.
#- sh -e /etc/init.d/xvfb start
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
# before_script:
# - pip install --user protobuf
# script: node build-system/pr-check.js
# after_script:
# - build-system/sauce_connect/stop_sauce_connect.sh
- pip install urllib3[secure]
- pip install gsutil --user
branches:
only:
- master
- release
- canary
- /^amp-release-.*$/
- /^revert-.*$/
addons:
chrome: stable
hosts:
- ads.localhost
- iframe.localhost
# Requested by some tests because they need a valid font host,
# but should not resolve in tests.
- fonts.googleapis.com
apt:
packages:
- protobuf-compiler
- python-protobuf
stages:
- build
- test
jobs:
fast_finish: true
allowed_failures:
- stage: test
name: "Remote (Sauce Labs) Tests"
script:
- node build-system/pr-check/remote-test.js
after_script:
- build-system/sauce_connect/stop_sauce_connect.sh
include:
- stage: build
name: "Build"
script:
- node build-system/pr-check/build-job.js #TODO(estherkim)
# - stage: build
# name: "Checks"
# script:
# - node build-system/pr-check/checks-job.js #TODO(estherkim)
# - stage: build
# name: "Validator"
# before_script:
# - pip install --user protobuf #required by validator
# script:
# - node build-system/pr-check/validator-job.js #TODO(estherkim)
# - stage: test
# name: "Dist, Bundle Size, Single Pass Tests"
# script:
# - node build-system/pr-check/dist-tests-job.js #TODO(estherkim)
# - stage: test
# name: "Visual Diff Tests"
# script:
# - node build-system/pr-check/visual-diff-tests-job.js #TODO(estherkim)
# - stage: test
# name: "Local Tests"
# script:
# - node build-system/pr-check/local-tests-job.js #TODO(estherkim)
# - stage: test
# name: "Remote (Sauce Labs) Tests"
# script:
# - node build-system/pr-check/remote-tests-job.js #TODO(estherkim)
- node build-system/pr-check/build.js
- stage: build
name: "Checks"
script:
- node build-system/pr-check/checks.js
- stage: build
name: "Validator"
before_script:
- pip install --user protobuf #required by validator
script:
- node build-system/pr-check/validator.js
addons:
apt:
packages:
- protobuf-compiler
- python-protobuf
- stage: test
name: "Dist, Bundle Size, Single Pass Tests"
script:
- node build-system/pr-check/dist-test.js
- stage: test
name: "Visual Diff Tests"
script:
- node build-system/pr-check/visual-diff-test.js
- stage: test
name: "Local Tests"
before_install:
- export CHROME_BIN=google-chrome-stable
- export DISPLAY=:99.0
# Explicitly add yarn and gsutil install because this section overrides before_install parent section
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
- pip install urllib3[secure]
- pip install gsutil --user
addons:
chrome: stable
hosts:
- ads.localhost
- iframe.localhost
# Requested by some tests because they need a valid font host,
# but should not resolve in tests.
- fonts.googleapis.com
script:
- node build-system/pr-check/local-test.js
- stage: test
name: "Remote (Sauce Labs) Tests"
script:
- node build-system/pr-check/remote-test.js
after_script:
- build-system/sauce_connect/stop_sauce_connect.sh
cache:
yarn: true
directories:
Expand Down
204 changes: 0 additions & 204 deletions build-system/pr-check/build-job.js

This file was deleted.

8 changes: 5 additions & 3 deletions build-system/pr-check/build-target.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@
* This script attempts to introduce some granularity for our
* presubmit checking, via the determineBuildTargets method.
*/
const config = require('./config');
const config = require('../config');
const minimatch = require('minimatch');
const path = require('path');
const {gitDiffNameOnlyMaster} = require('../git');

/**
* Determines whether the given file belongs to the Validator webui,
Expand Down Expand Up @@ -186,10 +187,11 @@ function isFlagConfig(filePath) {
/**
* Determines the targets that will be executed by the main method of
* this script. The order within this function matters.
* @param {!Array<string>} filePaths
* @return {!Set<string>}
*/
function determineBuildTargets(filePaths) {
function determineBuildTargets() {
const filePaths = gitDiffNameOnlyMaster();

if (filePaths.length == 0) {
return new Set([
'BUILD_SYSTEM',
Expand Down
Loading

0 comments on commit cb95582

Please sign in to comment.