Adding matrix to travis (#84)

* Adding matrix to travis

* Adding matrix to travis

* Remove star

* Adding node modules to caching

* Adding badges to README
This commit is contained in:
Matt Gaunt
2016-12-09 17:12:53 -05:00
committed by Jeffrey Posnick
parent 564ba5f293
commit e2ca7a9cd3
7 changed files with 121 additions and 13 deletions
+19 -3
View File
@@ -2,9 +2,25 @@ sudo: required
dist: trusty
language: node_js
cache:
directories:
- node_modules
node_js:
- 'stable'
env:
- PROJECT="sw-appcache-behavior"
- PROJECT="sw-background-sync-queue"
- PROJECT="sw-broadcast-cache-update"
- PROJECT="sw-cache-expiration"
- PROJECT="sw-cli"
- PROJECT="sw-lib"
- PROJECT="sw-offline-google-analytics"
- PROJECT="sw-precaching"
- PROJECT="sw-routing"
- PROJECT="sw-runtime-caching"
# Read more here: https://docs.travis-ci.com/user/gui-and-headless-browsers/#Using-xvfb-to-Run-Tests-That-Require-a-GUI
before_script:
- "export DISPLAY=:99.0"
@@ -12,6 +28,6 @@ before_script:
- sleep 3 # give xvfb some time to start
script:
- gulp lint
- gulp build
- gulp test
- gulp lint --project "${PROJECT}"
- gulp build --project "${PROJECT}"
- gulp test --project "${PROJECT}"
+70 -1
View File
@@ -1,10 +1,39 @@
<!-- To make changes, edit templates/README.hbs, not README.md! -->
[![Build Status][travis-image]][travis-url]
[![Dependency Status][dependency-image]][dependency-url]
[![Dev Dependency Status][dev-dependency-image]][dev-dependency-url]
# Service Worker Framework
# SW Helpers
## The Libraries
### sw-appcache-behavior
[![Build Status](https://travis-shields.appspot.com/shield/GoogleChrome/sw-helpers/master/PROJECT%3D%22sw-appcache-behavior%22)][travis-url]
A service worker implementation of the behavior defined in a page&#x27;s App Cache manifest.
**Install**: `npm install --save-dev sw-appcache-behavior`
**Learn More**: [About](packages/sw-appcache-behavior) •
[Demo](packages/sw-appcache-behavior#demo) •
[API](packages/sw-appcache-behavior#api)
### sw-background-sync-queue
[![Build Status](https://travis-shields.appspot.com/shield/GoogleChrome/sw-helpers/master/PROJECT%3D%22sw-background-sync-queue%22)][travis-url]
A service worker implementation of the a queue which is triggered by the background sync event.
**Install**: `npm install --save-dev sw-background-sync-queue`
**Learn More**: [About](packages/sw-background-sync-queue) •
[Demo](packages/sw-background-sync-queue#demo) •
[API](packages/sw-background-sync-queue#api)
### sw-broadcast-cache-update
[![Build Status](https://travis-shields.appspot.com/shield/GoogleChrome/sw-helpers/master/PROJECT%3D%22sw-broadcast-cache-update%22)][travis-url]
A helper library that uses the Broadcast Channel API to announce when two Response objects differ.
**Install**: `npm install --save-dev sw-broadcast-cache-update`
@@ -14,6 +43,9 @@ A helper library that uses the Broadcast Channel API to announce when two Respon
[API](packages/sw-broadcast-cache-update#api)
### sw-cache-expiration
[![Build Status](https://travis-shields.appspot.com/shield/GoogleChrome/sw-helpers/master/PROJECT%3D%22sw-cache-expiration%22)][travis-url]
This library is still a work in progress and is not functional.
**Install**: `npm install --save-dev sw-cache-expiration`
@@ -22,7 +54,34 @@ This library is still a work in progress and is not functional.
[Demo](packages/sw-cache-expiration#demo) •
[API](packages/sw-cache-expiration#api)
### sw-lib
[![Build Status](https://travis-shields.appspot.com/shield/GoogleChrome/sw-helpers/master/PROJECT%3D%22sw-lib%22)][travis-url]
A service worker library to make managing fetch requests and caching as easy as possible.
**Install**: `npm install --save-dev sw-lib`
**Learn More**: [About](packages/sw-lib) •
[Demo](packages/sw-lib#demo) •
[API](packages/sw-lib#api)
### sw-offline-google-analytics
[![Build Status](https://travis-shields.appspot.com/shield/GoogleChrome/sw-helpers/master/PROJECT%3D%22sw-offline-google-analytics%22)][travis-url]
A service worker helper library to retry offline Google Analytics requests when a connection is available.
**Install**: `npm install --save-dev sw-offline-google-analytics`
**Learn More**: [About](packages/sw-offline-google-analytics) •
[Demo](packages/sw-offline-google-analytics#demo) •
[API](packages/sw-offline-google-analytics#api)
### sw-precaching
[![Build Status](https://travis-shields.appspot.com/shield/GoogleChrome/sw-helpers/master/PROJECT%3D%22sw-precaching%22)][travis-url]
This library is still a work in progress and is not functional.
**Install**: `npm install --save-dev sw-precaching`
@@ -32,6 +91,9 @@ This library is still a work in progress and is not functional.
[API](packages/sw-precaching#api)
### sw-routing
[![Build Status](https://travis-shields.appspot.com/shield/GoogleChrome/sw-helpers/master/PROJECT%3D%22sw-routing%22)][travis-url]
A service worker helper library to route request URLs to handlers.
**Install**: `npm install --save-dev sw-routing`
@@ -41,6 +103,9 @@ A service worker helper library to route request URLs to handlers.
[API](packages/sw-routing#api)
### sw-runtime-caching
[![Build Status](https://travis-shields.appspot.com/shield/GoogleChrome/sw-helpers/master/PROJECT%3D%22sw-runtime-caching%22)][travis-url]
A service worker helper library that implements various runtime caching strategies.
**Install**: `npm install --save-dev sw-runtime-caching`
@@ -75,3 +140,7 @@ limitations under the License.
[npm-image]: https://badge.fury.io/js/sw-helpers.svg
[travis-url]: https://travis-ci.org/GoogleChrome/sw-helpers
[travis-image]: https://travis-ci.org/GoogleChrome/sw-helpers.svg?branch=master
[dependency-url]: https://david-dm.org/GoogleChrome/sw-helpers/
[dependency-image]: https://david-dm.org/GoogleChrome/sw-helpers/dev-status.svg
[dev-dependency-url]: https://david-dm.org/GoogleChrome/sw-helpers?type=dev
[dev-dependency-image]: https://david-dm.org/GoogleChrome/sw-helpers/status.svg
+8 -1
View File
@@ -15,6 +15,7 @@
const seleniumAssistant = require('selenium-assistant');
const gulp = require('gulp');
const mocha = require('gulp-spawn-mocha');
const glob = require('glob');
gulp.task('download-browsers', function() {
console.log(' Starting browser download.....');
@@ -36,7 +37,13 @@ gulp.task('test', ['download-browsers'], () => {
if (global.cliOptions.grep) {
mochaOptions.grep = global.cliOptions.grep;
}
return gulp.src(`packages/${global.projectOrStar}/test/*.js`, {read: false})
const testGlob = `packages/${global.projectOrStar}/test/*.js`;
const testFiles = glob.sync(testGlob);
if (testFiles.length === 0) {
// Mocha fails when no tests are found so return early.
return;
}
return gulp.src(testGlob, {read: false})
.pipe(mocha(mochaOptions))
.once('error', (error) => {
console.error(error);
+21 -6
View File
@@ -69,13 +69,28 @@ describe('sw-lib Tests', function() {
);
})
.then((testResults) => {
if (testResults.failed.length > 0) {
const errorMessage = swTestingHelpers.mochaUtils.prettyPrintErrors(
assistantDriver.getPrettyName(),
testResults
);
// Print test failues
const passedTests = testResults.passed;
const passedStrings = passedTests.map((test, i) => {
return `[Passed Test ${i + 1}]\n` +
` - ${test.parentTitle} > ${test.title}\n`;
});
const failedTests = testResults.failed;
const failedStrings = failedTests.map((test, i) => {
return `[Failed Test ${i + 1}]\n` +
` - ${test.parentTitle} > ${test.title}\n`;
});
console.log('-------------------------------------------');
if (passedTests.length > 0) {
console.log(passedStrings.join('\n'));
}
if (failedTests.length > 0) {
console.log(failedStrings.join('\n'));
}
console.log('---------------------------------------------------');
throw new Error(errorMessage);
if (testResults.failed.length > 0) {
throw new Error('Failing tests');
}
});
});
@@ -3,7 +3,6 @@ importScripts('/node_modules/chai/chai.js');
importScripts('/node_modules/sw-testing-helpers/browser/mocha-utils.js');
importScripts('/packages/sw-lib/build/sw-lib.min.js');
importScripts('/packages/sw-routing/build/sw-routing.min.js');
/* global goog */
@@ -3,7 +3,6 @@ importScripts('/node_modules/chai/chai.js');
importScripts('/node_modules/sw-testing-helpers/browser/mocha-utils.js');
importScripts('/packages/sw-lib/build/sw-lib.min.js');
importScripts('/packages/sw-routing/build/sw-routing.min.js');
/* global goog */
+3
View File
@@ -8,6 +8,9 @@
## The Libraries
{{#each projects}}
### {{name}}
[![Build Status](https://travis-shields.appspot.com/shield/GoogleChrome/sw-helpers/master/PROJECT%3D%22{{name}}%22)][travis-url]
{{description}}
**Install**: `npm install --save-dev {{name}}`