Browse Source

organize ci settings

Yuki Takei 4 years ago
parent
commit
eca694d9ca

+ 1 - 1
.github/workflows/ci-slackbot-proxy.yml

@@ -196,7 +196,7 @@ jobs:
         yarn list --depth=0
         yarn list --depth=0
     - name: lerna run build
     - name: lerna run build
       run: |
       run: |
-        yarn lerna run build
+        yarn lerna run build --scope @growi/slack --scope @growi/slackbot-proxy
     - name: lerna bootstrap --production
     - name: lerna bootstrap --production
       run: |
       run: |
         npx lerna bootstrap -- --production
         npx lerna bootstrap -- --production

+ 14 - 10
.github/workflows/ci.yml

@@ -49,9 +49,12 @@ jobs:
         echo -n "node " && node -v
         echo -n "node " && node -v
         echo -n "npm " && npm -v
         echo -n "npm " && npm -v
         yarn list --depth=0
         yarn list --depth=0
-    - name: yarn lint
+    - name: yarn test:lint for plugins
       run: |
       run: |
-        yarn lint
+        yarn lerna run test:lint --scope @growi/plugin-pukiwiki-like-linker
+    - name: yarn test:lint for app
+      run: |
+        yarn lerna run test:lint --scope @growi/slack --scope @growi/app
 
 
     - name: Slack Notification
     - name: Slack Notification
       uses: weseek/ghaction-slack-notification@master
       uses: weseek/ghaction-slack-notification@master
@@ -114,14 +117,16 @@ jobs:
         echo -n "node " && node -v
         echo -n "node " && node -v
         echo -n "npm " && npm -v
         echo -n "npm " && npm -v
         yarn list --depth=0
         yarn list --depth=0
-    - name: yarn test
+    - name: yarn test:unit
+      working-directory: ./packages/app
       run: |
       run: |
-        yarn test
+        yarn test:unit
       env:
       env:
         MONGO_URI: mongodb://localhost:${{ job.services.mongodb.ports['27017'] }}/growi_test
         MONGO_URI: mongodb://localhost:${{ job.services.mongodb.ports['27017'] }}/growi_test
-    - name: yarn test with MongoDB 3.6
+    - name: yarn test:unit with MongoDB 3.6
+      working-directory: ./packages/app
       run: |
       run: |
-        yarn test
+        yarn test:unit
       env:
       env:
         MONGO_URI: mongodb://localhost:${{ job.services.mongodb36.ports['27017'] }}/growi_test
         MONGO_URI: mongodb://localhost:${{ job.services.mongodb36.ports['27017'] }}/growi_test
 
 
@@ -192,9 +197,9 @@ jobs:
         echo -n "node " && node -v
         echo -n "node " && node -v
         echo -n "npm " && npm -v
         echo -n "npm " && npm -v
         yarn list --depth=0
         yarn list --depth=0
-    - name: yarn build:dev
+    - name: yarn dev:client
       run: |
       run: |
-        yarn build:dev
+        yarn dev:client
 
 
     - name: Slack Notification
     - name: Slack Notification
       uses: weseek/ghaction-slack-notification@master
       uses: weseek/ghaction-slack-notification@master
@@ -266,8 +271,7 @@ jobs:
         yarn list --depth=0
         yarn list --depth=0
     - name: Build
     - name: Build
       run: |
       run: |
-        yarn lerna run build --scope @growi/slack
-        yarn lerna run build --scope @growi/app
+        yarn lerna run build --scope @growi/slack --scope @growi/app
     - name: lerna bootstrap --production
     - name: lerna bootstrap --production
       run: |
       run: |
         npx lerna bootstrap -- --production
         npx lerna bootstrap -- --production

+ 5 - 6
packages/app/package.json

@@ -11,12 +11,11 @@
     "dev:server": "env-cmd -f config/env.dev.js yarn ts-node-dev src/server/app.ts --expose_gc --inspect",
     "dev:server": "env-cmd -f config/env.dev.js yarn ts-node-dev src/server/app.ts --expose_gc --inspect",
     "dev": "run-p dev:*",
     "dev": "run-p dev:*",
     "predev:client": "yarn prebuild",
     "predev:client": "yarn prebuild",
-    "lint:js:fix": "eslint \"**/*.{js,jsx,ts,tsx}\" --fix",
-    "lint:js": "eslint \"**/*.{js,jsx,ts,tsx}\"",
-    "lint:styles:fix": "stylelint --fix src/**/*.scss",
-    "lint:styles": "stylelint src/**/*.scss",
-    "lint:swagger2openapi": "node node_modules/swagger2openapi/oas-validate tmp/swagger.json",
-    "lint": "run-p lint:js lint:styles lint:swagger2openapi",
+    "test:lint:js": "eslint \"**/*.{js,jsx,ts,tsx}\"",
+    "test:lint:styles": "stylelint src/**/*.scss",
+    "test:lint:swagger2openapi": "node node_modules/swagger2openapi/oas-validate tmp/swagger.json",
+    "test:lint": "run-p lint:*",
+    "test:unit": "cross-env NODE_ENV=test jest --passWithNoTests -- ",
     "migrate": "yarn migrate:up",
     "migrate": "yarn migrate:up",
     "migrate:create": "yarn ts-node node_modules/.bin/migrate-mongo create -f config/migrate.js -- ",
     "migrate:create": "yarn ts-node node_modules/.bin/migrate-mongo create -f config/migrate.js -- ",
     "migrate:status": "yarn ts-node node_modules/.bin/migrate-mongo status -f config/migrate.js",
     "migrate:status": "yarn ts-node node_modules/.bin/migrate-mongo status -f config/migrate.js",

+ 1 - 2
packages/slack/package.json

@@ -8,9 +8,8 @@
     "build": "yarn tsc && tsc-alias -p tsconfig.build.json",
     "build": "yarn tsc && tsc-alias -p tsconfig.build.json",
     "tsc": "tsc -p tsconfig.build.json",
     "tsc": "tsc -p tsconfig.build.json",
     "tsc:w": "yarn tsc -w",
     "tsc:w": "yarn tsc -w",
-    "test": "yarn test:lint && yarn test:coverage",
+    "test": "yarn test:lint && yarn test:unit",
     "test:unit": "cross-env NODE_ENV=test jest --passWithNoTests",
     "test:unit": "cross-env NODE_ENV=test jest --passWithNoTests",
-    "test:coverage": "yarn test:unit",
     "test:lint": "eslint src --ext .ts",
     "test:lint": "eslint src --ext .ts",
     "test:lint:fix": "eslint src --ext .ts --fix"
     "test:lint:fix": "eslint src --ext .ts --fix"
   },
   },

+ 1 - 2
packages/slackbot-proxy/package.json

@@ -16,9 +16,8 @@
     "start:prod": "cross-env NODE_ENV=production node -r dotenv-flow/config dist/index.js",
     "start:prod": "cross-env NODE_ENV=production node -r dotenv-flow/config dist/index.js",
     "postbuild": "yarn cp:public && yarn cp:views && yarn cp:bootstrap",
     "postbuild": "yarn cp:public && yarn cp:views && yarn cp:bootstrap",
     "predev": "yarn cp:bootstrap:dev",
     "predev": "yarn cp:bootstrap:dev",
-    "test": "yarn test:lint && yarn test:coverage",
+    "test": "yarn test:lint && yarn test:unit",
     "test:unit": "cross-env NODE_ENV=test jest --passWithNoTests",
     "test:unit": "cross-env NODE_ENV=test jest --passWithNoTests",
-    "test:coverage": "yarn test:unit",
     "test:lint": "eslint src --ext .ts",
     "test:lint": "eslint src --ext .ts",
     "test:lint:fix": "eslint src --ext .ts --fix",
     "test:lint:fix": "eslint src --ext .ts --fix",
     "version": "node -p \"require('./package.json').version\""
     "version": "node -p \"require('./package.json').version\""