Browse Source

add 'lint' pipeline to wercker.yml

Yuki Takei 7 years ago
parent
commit
6a33688942
2 changed files with 33 additions and 2 deletions
  1. 3 2
      package.json
  2. 30 0
      wercker.yml

+ 3 - 2
package.json

@@ -32,10 +32,11 @@
     "clean:report": "rimraf -- report",
     "clean": "npm-run-all -p clean:*",
     "heroku-postbuild": "sh bin/heroku/install-plugins.sh && npm run build:prod",
-    "lint:fix": "eslint . --fix",
+    "lint:js:fix": "eslint . --fix",
+    "lint:js": "eslint .",
     "lint:styles:fix": "prettier-stylelint --quiet --write src/client/styles/scss/**/*.scss",
     "lint:styles": "stylelint src/client/styles/scss/**/*.scss",
-    "lint": "eslint .",
+    "lint": "npm-run-all -p lint:js lint:styles",
     "migrate": "npm run migrate:up",
     "migrate:create": "migrate-mongo create -f config/migrate.js -- ",
     "migrate:status": "migrate-mongo status -f config/migrate.js",

+ 30 - 0
wercker.yml

@@ -36,6 +36,36 @@ test:
       username: wercker
       notify_on: "failed"
 
+lint:
+  steps:
+    - script:
+      name: set yarn cache-folder
+      code: yarn config set cache-folder $WERCKER_CACHE_DIR/yarn
+
+    - script:
+      name: install dependencies
+      code: |
+        yarn
+
+    - script:
+      name: print dependencies
+      code: |
+        echo -n "node " && node -v
+        echo -n "npm " && npm -v
+        yarn list --depth=0
+
+    - script:
+      name: npm run lint
+      code: |
+        npm run lint
+
+  after-steps:
+    - slack-notifier:
+      url: $SLACK_WEBHOOK_URL
+      channel: ci
+      username: wercker
+      notify_on: "failed"
+
 
 build-prod:
   steps: