浏览代码

Added travis for PR check

zhixin 6 年之前
父节点
当前提交
aa90b0c884
共有 3 个文件被更改,包括 30 次插入34 次删除
  1. 24 16
      .travis.yml
  2. 6 3
      package.json
  3. 0 15
      tools/package.json

+ 24 - 16
.travis.yml

@@ -1,18 +1,26 @@
-language: ruby
-rvm:
-  - 2.4.1
+stages:
+  - test
+  - deploy
 
-script: bash ./deploy.sh
+jobs:
+  include:
+    - stage: test
+      language: node_js
+      node_js:
+        - 10
+      name: "Lint src and check docs"
+      script: npm run pre-commit
+      if: type = pull_request
 
-branches:
-  only:
-  - master
-
-env:
-  global:
-  - ENCRYPTION_LABEL: "5453d0fdf68a"
-  - COMMIT_AUTHOR_EMAIL: "wenzhixin2010@gmail.com"
-
-sudo: false
-
-cache: bundler
+    - stage: deploy
+      name: "Deploy docs"
+      language: ruby
+      rvm:
+        - 2.4.1
+      script: ./deploy.sh
+      if: branch = master AND type = push
+      env:
+        global:
+        - ENCRYPTION_LABEL: "5453d0fdf68a"
+        - COMMIT_AUTHOR_EMAIL: "wenzhixin2010@gmail.com"
+      cache: bundler

+ 6 - 3
package.json

@@ -26,14 +26,17 @@
     "sass": "^1.16.1",
     "stylelint": "^10.1.0",
     "stylelint-config-standard": "^18.3.0",
-    "vue-template-compiler": "^2.6.10"
+    "vue-template-compiler": "^2.6.10",
+    "chalk": "^2.4.2",
+    "esm": "^3.2.25",
+    "safe-eval": "^0.4.1"
   },
   "scripts": {
     "lint:js": "eslint src",
     "lint:css": "stylelint src/**/*.scss",
     "lint": "run-s lint:*",
-    "docs:check:api": "cd tools/ && nodejs check-api.js",
-    "docs:check:locale": "cd tools/ && nodejs check-locale.js",
+    "docs:check:api": "cd tools && node check-api.js",
+    "docs:check:locale": "cd tools && node check-locale.js",
     "docs:check": "run-s docs:check:*",
     "docs:serve": "bundle exec jekyll serve",
     "docs": "bundle exec jekyll build",

+ 0 - 15
tools/package.json

@@ -1,15 +0,0 @@
-{
-  "name": "tools",
-  "version": "1.0.0",
-  "main": "index.js",
-  "license": "MIT",
-  "dependencies": {
-    "chalk": "^2.4.2",
-    "esm": "^3.2.25",
-    "safe-eval": "^0.4.1"
-  },
-  "scripts": {
-    "check-api": "node check-api",
-    "check-locale": "node check-locale"
-  }
-}