From 76f2977ef8402fb38bb4f01c6d98289a39f7a580 Mon Sep 17 00:00:00 2001 From: Artur Yorsh Date: Wed, 29 May 2019 11:53:08 +0300 Subject: [PATCH] feat(ci): add travis-ci config --- .travis.yml | 15 +++++++++++++ package.json | 11 +++++---- packages/dss/package.json | 6 ++--- packages/eva/package.json | 8 +++---- packages/processor/js/scripts/generate.ts | 6 ++--- packages/processor/package.json | 8 +++---- scripts/travis-ci-script.sh | 27 +++++++++++++++++++++++ 7 files changed, 63 insertions(+), 18 deletions(-) create mode 100644 .travis.yml create mode 100755 scripts/travis-ci-script.sh diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..83530e3 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,15 @@ +sudo: false +language: node_js +node_js: +- '8' +env: + matrix: + - MODE=lint + - MODE=build + - MODE=test +matrix: + fast_finish: true +install: +- npm i +script: +- scripts/travis-ci-script.sh diff --git a/package.json b/package.json index 6c82b1d..a0aec40 100644 --- a/package.json +++ b/package.json @@ -5,10 +5,10 @@ "version": "0.0.1", "license": "MIT", "author": "akveo ", - "homepage": "https://github.com/akveo/eva#readme", - "repository": "git+https://github.com/akveo/eva.git", + "homepage": "https://github.com/eva-design/eva#readme", + "repository": "git+https://github.com/eva-design/eva.git", "bugs": { - "url": "https://github.com/akveo/eva/issues" + "url": "https://github.com/eva-design/eva/issues" }, "scripts": { "build": "tsc", @@ -17,7 +17,10 @@ "lint:fix": "npm run lint -- --fix", "gen:js": "ts-node ./packages/processor/js/scripts/generateExisting", "gen:js-custom": "ts-node ./packages/processor/js/scripts/customize", - "test": "jest" + "test": "jest", + "ci:lint": "npm run lint", + "ci:build": "npm run build", + "ci:test": "npm run test" }, "devDependencies": { "@types/jest": "^24.0.13", diff --git a/packages/dss/package.json b/packages/dss/package.json index 01643f8..485016f 100644 --- a/packages/dss/package.json +++ b/packages/dss/package.json @@ -4,9 +4,9 @@ "version": "0.0.1", "license": "MIT", "author": "akveo ", - "homepage": "https://github.com/akveo/eva#readme", - "repository": "git+https://github.com/akveo/eva.git", + "homepage": "https://github.com/eva-design/eva#readme", + "repository": "git+https://github.com/eva-design/eva.git", "bugs": { - "url": "https://github.com/akveo/eva/issues" + "url": "https://github.com/eva-design/eva/issues" } } diff --git a/packages/eva/package.json b/packages/eva/package.json index 9c1036c..b4df738 100644 --- a/packages/eva/package.json +++ b/packages/eva/package.json @@ -4,12 +4,12 @@ "version": "0.0.1", "license": "MIT", "author": "akveo ", - "homepage": "https://github.com/akveo/eva#readme", - "repository": "git+https://github.com/akveo/eva.git", + "homepage": "https://github.com/eva-design/eva#readme", + "repository": "git+https://github.com/eva-design/eva.git", "bugs": { - "url": "https://github.com/akveo/eva/issues" + "url": "https://github.com/eva-design/eva/issues" }, "devDependencies": { - "@eva-design/dss": "github:akveo/eva#package/dss" + "@eva-design/dss": "github:eva-design/eva#package/dss" } } diff --git a/packages/processor/js/scripts/generate.ts b/packages/processor/js/scripts/generate.ts index a88dd66..f965254 100644 --- a/packages/processor/js/scripts/generate.ts +++ b/packages/processor/js/scripts/generate.ts @@ -28,10 +28,10 @@ export function generateMappingPackage(source: string) { version: '0.0.1', license: 'MIT', author: 'akveo ', - homepage: 'https://github.com/akveo/eva#readme', - repository: 'git+https://github.com/akveo/eva.git', + homepage: 'https://github.com/eva-design/eva#readme', + repository: 'git+https://github.com/eva-design/eva.git', bugs: { - url: 'https://github.com/akveo/eva/issues', + url: 'https://github.com/eva-design/eva/issues', }, }); diff --git a/packages/processor/package.json b/packages/processor/package.json index 4f5747a..0b2ab06 100644 --- a/packages/processor/package.json +++ b/packages/processor/package.json @@ -4,12 +4,12 @@ "version": "0.0.1", "license": "MIT", "author": "akveo ", - "homepage": "https://github.com/akveo/eva#readme", - "repository": "git+https://github.com/akveo/eva.git", + "homepage": "https://github.com/eva-design/eva#readme", + "repository": "git+https://github.com/eva-design/eva.git", "bugs": { - "url": "https://github.com/akveo/eva/issues" + "url": "https://github.com/eva-design/eva/issues" }, "devDependencies": { - "@eva-design/dss": "github:akveo/eva#package/dss" + "@eva-design/dss": "github:eva-design/eva#package/dss" } } diff --git a/scripts/travis-ci-script.sh b/scripts/travis-ci-script.sh new file mode 100755 index 0000000..fb6ede2 --- /dev/null +++ b/scripts/travis-ci-script.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +# Script that runs in every Travis CI container. The script is responsible for delegating +# to the different scripts that should run for specific Travis jobs in a build stage. + +# The script should immediately exit if any command in the script fails. +set -e + +# Go to project directory +cd $(dirname $0)/.. + +echo "" +echo "Building sources and running tests. Running mode: ${MODE}" +echo "" + +if [[ -z "$TRAVIS" ]]; then + echo "This script can only run inside of Travis build jobs." + exit 1 +fi + +if [[ "${MODE}" = lint ]]; then + npm run ci:lint +elif [[ "${MODE}" = build ]]; then + npm run ci:build +elif [[ "${MODE}" =~ test ]]; then + npm run ci:test +fi