Skip to content
This repository was archived by the owner on Apr 14, 2021. It is now read-only.

Commit 772ced3

Browse files
author
Andy Earnshaw
committed
Travis CI improvements
- Cache NPM modules across builds - Don't run Sauce Labs tests for pull requests
1 parent be22e7f commit 772ced3

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

.travis.yml

+6
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,9 @@ addons:
88
username: andyearnshaw
99
access_key:
1010
secure: 'OslPEaqVgNH+9YWwtEIJE4/Ot+RmSonIYMxvxMjnaaLAkoYX34nJzaB8vPFP1txDwkDHpOy+MiQ8hKYhyilw5Ydr11O2IEuhVjcJThKSoN3yMTe6FHpXQKO9uC1loaRwJs2uV0go+P4ooywZ8Y72/RtKXk0OOhn5Lg5ekb3wMRg='
11+
12+
cache:
13+
directories:
14+
- node_modules
15+
16+
sudo: false

tests/saucelabs.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,12 @@ function main(tunnelReady) {
446446
// Save the current cursor position for redraws
447447
drawStatus();
448448

449-
if (tunnel) {
449+
// Avoid "The Travis CI build failed" message on PRs
450+
if (process.env.TRAVIS_PULL_REQUEST) {
451+
console.warn('Unable to run Sauce Labs tests for pull requests.');
452+
process.exit(0);
453+
}
454+
else if (tunnel) {
450455
tunnel.start(main);
451456
tunnel.proc.stdout.on('data', function (msg) {
452457
lastTunnelMessage = String(msg).split('\n').shift();

0 commit comments

Comments
 (0)