From d86c6e0497bfbe5c633193888406f99f15aa8229 Mon Sep 17 00:00:00 2001 From: KtorZ Date: Thu, 6 Jul 2017 11:45:36 +0200 Subject: [PATCH] prepare CI environment --- .gitignore | 2 +- .travis.yml | 37 ++++++++++++++++ bower.json | 24 ++++++++-- deploy.sh | 3 ++ karma.browserstack.conf.js | 91 ++++++++++++++++++++++++++++++++++++++ package.json | 36 +++++++-------- 6 files changed, 169 insertions(+), 24 deletions(-) create mode 100644 .travis.yml create mode 100755 deploy.sh create mode 100644 karma.browserstack.conf.js diff --git a/.gitignore b/.gitignore index 9d22143..0af7b4a 100644 --- a/.gitignore +++ b/.gitignore @@ -71,9 +71,9 @@ typings/ # Generated files output generated-docs +releases .pulp-cache .psc* .purs* .psa* dist -src/Main.purs diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..726f0d2 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,37 @@ +language: node_js +node_js: + - node + +addons: + browserstack: + username: $BROWSERSTACK_USERNAME + access_key: $BROWSERSTACK_ACCESSKEY + +before_install: + - export PATH=./node_modules/.bin:$PATH + +install: + - npm install + - bower install + +script: + - npm run test:browserstack + +after_script: + - npm run prepare:release + +deploy: + - provider: releases + api_key: $GITHUB_TOKEN + skip_cleanup: true + file_glob: true + file: releases/github/* + on: + tags: true + branch: master + + - provider: script + script: deploy.sh + on: + tags: true + branch: master diff --git a/bower.json b/bower.json index 16bcbe1..4931d0a 100644 --- a/bower.json +++ b/bower.json @@ -1,19 +1,37 @@ { "name": "purescript-indexeddb", + "description": "An API wrapper around IndexedDB", + "version": "1.0.0", + "authors": [ + "Matthias Benkort " + ], "ignore": [ "**/.*", "node_modules", "bower_components", - "output" + "output", + "test", + "dist", + "releases", + "package.json", + "karma.conf.js", + "karma.browserstack.conf.js", + "deploy.sh" ], + "license": "MIT", + "homepage": "https://github.com/truqu/purescript-indexeddb", + "repository": { + "type": "git", + "url": "git://github.com/KtorZ/purescript-ifrit.git" + }, "dependencies": { "purescript-maybe": "3.0.0", "purescript-aff": "3.1.0", - "purescript-spec": "1.0.0", "purescript-datetime": "3.2.0" }, "devDependencies": { + "purescript-spec": "1.0.0", "purescript-psci-support": "3.0.0", - "purescript-now": "^3.0.0" + "purescript-now": "3.0.0" } } diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 0000000..7e0e06a --- /dev/null +++ b/deploy.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +test -n "$TRAVIS_TAG" && ( yes | pulp publish --no-push ) diff --git a/karma.browserstack.conf.js b/karma.browserstack.conf.js new file mode 100644 index 0000000..5bb2dde --- /dev/null +++ b/karma.browserstack.conf.js @@ -0,0 +1,91 @@ +module.exports = (config) => { + config.set({ + browsers: [ + 'FirefoxMAC', + 'ChromeMAC', + // 'SafariMAC', + 'OperaMAC', + + 'FirefoxWIN', + 'ChromeWIN', + 'OperaWIN', + ], + files: [ + 'dist/karma/index.js', + ], + frameworks: [ + 'mocha', + ], + plugins: [ + 'karma-browserstack-launcher', + 'karma-mocha', + ], + reporters: [ + 'dots', + 'BrowserStack', + ], + singleRun: true, + client: { + mocha: { + timeout: 10000, + }, + }, + browserStack: { + username: process.env.BROWSERSTACK_USERNAME, + accessKey: process.env.BROWSERSTACK_ACCESSKEY, + timeout: 1500, + captureTimeout: 500, + }, + customLaunchers: { + FirefoxMAC: { + base: 'BrowserStack', + browser: 'Firefox', + browser_version: '51', + os: 'OS X', + os_version: 'Sierra', + }, + ChromeMAC: { + base: 'BrowserStack', + browser: 'Chrome', + browser_version: '58', + os: 'OS X', + os_version: 'Sierra', + }, + SafariMAC: { + base: 'BrowserStack', + browser: 'Safari', + browser_version: '10.1', + os: 'OS X', + os_version: 'Sierra', + }, + OperaMAC: { + base: 'BrowserStack', + browser: 'Opera', + browser_version: '46', + os: 'OS X', + os_version: 'Sierra', + }, + FirefoxWIN: { + base: 'BrowserStack', + browser: 'Firefox', + browser_version: '51', + os: 'WINDOWS', + os_version: '10', + }, + ChromeWIN: { + base: 'BrowserStack', + browser: 'Chrome', + browser_version: '58', + os: 'WINDOWS', + os_version: '10', + }, + OperaWIN: { + base: 'BrowserStack', + browser: 'Opera', + browser_version: '46', + os: 'WINDOWS', + os_version: '10', + }, + }, + }); +}; diff --git a/package.json b/package.json index 385d404..a4469df 100644 --- a/package.json +++ b/package.json @@ -1,44 +1,40 @@ { "name": "purescript-indexeddb", "version": "1.0.0", - "description": "This document is a general grooming of the current state of the IndexedDB API. It covers only the features specified in the official specs.", - "main": "bundle.js", + "description": "A wrapper around the IndexedDB API", "scripts": { - "test:build": "pulp browserify -j 4 --main \"Test.Main\" -I test --to dist/karma/index.js", - "test:run": "karma start --single-run", - "test:watch": "find . -type f -regex '.*\\(src\\|test\\).*' ! -regex '.*bower_components.*\\|.*node_modules.*|.*\\.sw.*' | entr -s 'npm run test'", + "prepare:release": "mkdir -p releases/github && cp -r README.md LICENSE src bower.json releases/github", + "test:build": "mkdir -p dist/karma && pulp browserify -j 4 --main \"Test.Main\" -I test --to dist/karma/index.js", + "test:run": "karma start --single-run karma.conf.js", + "test:run:browserstack": "karma start karma.browserstack.conf.js", + "test:browserstack": "npm run test:build && npm run test:run:browserstack", "test": "npm run test:build && npm run test:run", - "build": "pulp browserify -j 4 -O --to dist/bundle.js", - "start": "find . -type f -regex '.*\\(src\\|test\\).*' ! -regex '.*bower_components.*\\|.*node_modules.*|.*\\.sw.*' | entr -s 'clear; pulp browserify -j 4 -t dist/bundle.js'", - "start:test": "karma start" - }, - "dependencies": { - "eslint": "^3.19.0", - "eslint-config-airbnb": "^15.0.1", - "eslint-plugin-import": "^2.3.0", - "eslint-plugin-jsx-a11y": "^5.0.3", - "eslint-plugin-react": "^7.1.0", - "karma": "^1.7.0" + "start": "find . -type f -regex '.*\\(src\\|test\\).*' ! -regex '.*bower_components.*\\|.*node_modules.*|.*\\.sw.*' | entr -s 'npm run test -s'" }, + "dependencies": {}, "devDependencies": { + "bower": "1.8.0", "eslint": "3.19.0", "eslint-config-airbnb": "15.0.1", "eslint-plugin-import": "2.5.0", "eslint-plugin-jsx-a11y": "5.0.3", "eslint-plugin-react": "7.1.0", "karma": "1.7.0", + "karma-browserstack-launcher": "1.3.0", "karma-chrome-launcher": "2.1.1", "karma-firefox-launcher": "1.0.1", - "karma-mocha": "^1.3.0", + "karma-mocha": "1.3.0", "karma-spec-reporter": "0.0.31", - "mocha": "^3.4.2" + "mocha": "3.4.2", + "pulp": "11.0.0", + "purescript": "0.11.5" }, "repository": { "type": "git", "url": "git+https://github.com/Truqu/purescript-indexeddb.git" }, - "author": "", - "license": "ISC", + "author": "Matthias Benkort ", + "license": "MIT", "bugs": { "url": "https://github.com/Truqu/purescript-indexeddb/issues" },