Browse Source

modify ci settings

Yuki Takei 5 years ago
parent
commit
f7a8dadcbf

+ 15 - 19
.github/workflows/ci-slackbot-proxy.yml

@@ -12,10 +12,6 @@ on:
       - package.json
       - package.json
       - yarn.lock
       - yarn.lock
 
 
-defaults:
-  run:
-    working-directory: packages/slackbot-proxy
-
 jobs:
 jobs:
 
 
   test:
   test:
@@ -36,7 +32,7 @@ jobs:
       uses: actions/cache@v2
       uses: actions/cache@v2
       with:
       with:
         path: node_modules
         path: node_modules
-        key: ${{ runner.OS }}-node_modules-${{ matrix.node-version }}-${{ hashFiles('./yarn.lock') }}
+        key: ${{ runner.OS }}-node_modules-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
     - name: Get yarn cache dir
     - name: Get yarn cache dir
       if: steps.cache-dependencies.outputs.cache-hit != 'true'
       if: steps.cache-dependencies.outputs.cache-hit != 'true'
       id: cache-yarn
       id: cache-yarn
@@ -46,21 +42,21 @@ jobs:
       uses: actions/cache@v2
       uses: actions/cache@v2
       with:
       with:
         path: ${{ steps.cache-yarn.outputs.dir }}
         path: ${{ steps.cache-yarn.outputs.dir }}
-        key: ${{ runner.os }}-yarn-${{ matrix.node-version }}-${{ hashFiles('./yarn.lock') }}
+        key: ${{ runner.os }}-yarn-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
         restore-keys: |
         restore-keys: |
           ${{ runner.os }}-yarn-${{ matrix.node-version }}-
           ${{ runner.os }}-yarn-${{ matrix.node-version }}-
     - name: Install dependencies
     - name: Install dependencies
       if: steps.cache-dependencies.outputs.cache-hit != 'true'
       if: steps.cache-dependencies.outputs.cache-hit != 'true'
       run: |
       run: |
-        yarn --frozen-lockfile
+        yarn lerna bootstrap
     - name: Print dependencies
     - name: Print dependencies
       run: |
       run: |
         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
       run: |
       run: |
-        yarn test
+        yarn lerna run test
 
 
     - name: Slack Notification
     - name: Slack Notification
       uses: weseek/ghaction-slack-notification@master
       uses: weseek/ghaction-slack-notification@master
@@ -101,7 +97,7 @@ jobs:
       uses: actions/cache@v2
       uses: actions/cache@v2
       with:
       with:
         path: node_modules
         path: node_modules
-        key: ${{ runner.OS }}-node_modules_dev-${{ matrix.node-version }}-${{ hashFiles('./yarn.lock') }}
+        key: ${{ runner.OS }}-node_modules_dev-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
     - name: Get yarn cache dir
     - name: Get yarn cache dir
       if: steps.cache-dependencies.outputs.cache-hit != 'true'
       if: steps.cache-dependencies.outputs.cache-hit != 'true'
       id: cache-yarn
       id: cache-yarn
@@ -111,13 +107,13 @@ jobs:
       uses: actions/cache@v2
       uses: actions/cache@v2
       with:
       with:
         path: ${{ steps.cache-yarn.outputs.dir }}
         path: ${{ steps.cache-yarn.outputs.dir }}
-        key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }}
+        key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
         restore-keys: |
         restore-keys: |
           ${{ runner.os }}-yarn-
           ${{ runner.os }}-yarn-
     - name: Install dependencies
     - name: Install dependencies
       if: steps.cache-dependencies.outputs.cache-hit != 'true'
       if: steps.cache-dependencies.outputs.cache-hit != 'true'
       run: |
       run: |
-        yarn --frozen-lockfile
+        yarn lerna bootstrap
     - name: Print dependencies
     - name: Print dependencies
       run: |
       run: |
         echo -n "node " && node -v
         echo -n "node " && node -v
@@ -125,8 +121,8 @@ jobs:
         yarn list --depth=0
         yarn list --depth=0
     - name: yarn dev:ci
     - name: yarn dev:ci
       run: |
       run: |
-        cp config/ci/.env.local.for-ci .env.local
-        yarn dev:ci
+        cp packages/slackbot-proxy/config/ci/.env.local.for-ci packages/slackbot-proxy/.env.local
+        yarn lerna run --scope slackbot-proxy dev:ci
       env:
       env:
         TYPEORM_CONNECTION: mysql
         TYPEORM_CONNECTION: mysql
         TYPEORM_HOST: localhost
         TYPEORM_HOST: localhost
@@ -191,7 +187,7 @@ jobs:
       uses: actions/cache@v2
       uses: actions/cache@v2
       with:
       with:
         path: ${{ steps.cache-yarn.outputs.dir }}
         path: ${{ steps.cache-yarn.outputs.dir }}
-        key: ${{ runner.os }}-yarn-${{ matrix.node-version }}-${{ hashFiles('./yarn.lock') }}
+        key: ${{ runner.os }}-yarn-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
         restore-keys: |
         restore-keys: |
           ${{ runner.os }}-yarn-
           ${{ runner.os }}-yarn-
     - name: Install dependencies
     - name: Install dependencies
@@ -204,10 +200,10 @@ jobs:
         yarn list --depth=0
         yarn list --depth=0
     - name: yarn build
     - name: yarn build
       run: |
       run: |
-        yarn build
+        yarn lerna run build
     - name: yarn install --production
     - name: yarn install --production
       run: |
       run: |
-        yarn install --production
+        yarn lerna exec "yarn install --production"
     - name: Print dependencies
     - name: Print dependencies
       run: |
       run: |
         echo -n "node " && node -v
         echo -n "node " && node -v
@@ -215,8 +211,8 @@ jobs:
         yarn list --production --depth=0
         yarn list --production --depth=0
     - name: yarn start:prod:ci
     - name: yarn start:prod:ci
       run: |
       run: |
-        cp config/ci/.env.local.for-ci .env.local
-        yarn start:prod:ci
+        cp packages/slackbot-proxy/config/ci/.env.local.for-ci packages/slackbot-proxy/.env.local
+        yarn lerna run --scope slackbot-proxy start:prod:ci
       env:
       env:
         TYPEORM_CONNECTION: mysql
         TYPEORM_CONNECTION: mysql
         TYPEORM_HOST: localhost
         TYPEORM_HOST: localhost

+ 1 - 1
packages/slack/package.json

@@ -6,7 +6,7 @@
   "typings": "dist/index.d.ts",
   "typings": "dist/index.d.ts",
   "scripts": {
   "scripts": {
     "build": "yarn tsc",
     "build": "yarn tsc",
-    "tsc": "tsc -b --verbose tsconfig.build.json && tsc-alias -p tsconfig.build.json",
+    "tsc": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
     "test": "yarn test:lint && yarn test:coverage",
     "test": "yarn test:lint && yarn test:coverage",
     "test:unit": "cross-env NODE_ENV=test jest --passWithNoTests",
     "test:unit": "cross-env NODE_ENV=test jest --passWithNoTests",
     "test:coverage": "yarn test:unit",
     "test:coverage": "yarn test:unit",

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

@@ -4,7 +4,7 @@
   "license": "MIT",
   "license": "MIT",
   "scripts": {
   "scripts": {
     "build": "yarn tsc",
     "build": "yarn tsc",
-    "tsc": "tsc -b --verbose tsconfig.build.json && tsc-alias -p tsconfig.build.json",
+    "tsc": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
     "tsc:w": "tsc -w",
     "tsc:w": "tsc -w",
     "dev:ci": "yarn dev --ci",
     "dev:ci": "yarn dev --ci",
     "dev": "cross-env NODE_ENV=development ts-node-dev -r tsconfig-paths/register -r dotenv-flow/config src/index.ts",
     "dev": "cross-env NODE_ENV=development ts-node-dev -r tsconfig-paths/register -r dotenv-flow/config src/index.ts",