|
|
@@ -22,64 +22,12 @@ concurrency:
|
|
|
|
|
|
jobs:
|
|
|
|
|
|
- test:
|
|
|
- runs-on: ubuntu-latest
|
|
|
-
|
|
|
- strategy:
|
|
|
- matrix:
|
|
|
- node-version: [16.x]
|
|
|
-
|
|
|
- steps:
|
|
|
- - uses: actions/checkout@v3
|
|
|
-
|
|
|
- - uses: actions/setup-node@v3
|
|
|
- with:
|
|
|
- node-version: ${{ matrix.node-version }}
|
|
|
- cache: 'yarn'
|
|
|
- cache-dependency-path: '**/yarn.lock'
|
|
|
-
|
|
|
- - name: Cache/Restore node_modules
|
|
|
- id: cache-dependencies
|
|
|
- uses: actions/cache@v3
|
|
|
- with:
|
|
|
- path: |
|
|
|
- **/node_modules
|
|
|
- key: node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
|
|
|
- restore-keys: |
|
|
|
- node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-
|
|
|
-
|
|
|
- - name: Install dependencies
|
|
|
- run: |
|
|
|
- yarn global add turbo
|
|
|
- yarn --frozen-lockfile
|
|
|
-
|
|
|
- - name: yarn lint
|
|
|
- working-directory: ./apps/slackbot-proxy
|
|
|
- run: |
|
|
|
- yarn lint
|
|
|
-
|
|
|
- - name: yarn test
|
|
|
- working-directory: ./apps/slackbot-proxy
|
|
|
- run: |
|
|
|
- yarn test
|
|
|
-
|
|
|
- - name: Slack Notification
|
|
|
- uses: weseek/ghaction-slack-notification@master
|
|
|
- if: failure()
|
|
|
- with:
|
|
|
- type: ${{ job.status }}
|
|
|
- job_name: '*Node CI for growi-bot-proxy - test (${{ matrix.node-version }})*'
|
|
|
- channel: '#ci'
|
|
|
- isCompactMode: true
|
|
|
- url: ${{ secrets.SLACK_WEBHOOK_URL }}
|
|
|
-
|
|
|
-
|
|
|
launch-dev:
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
strategy:
|
|
|
matrix:
|
|
|
- node-version: [16.x]
|
|
|
+ node-version: [18.x]
|
|
|
|
|
|
services:
|
|
|
mysql:
|
|
|
@@ -101,24 +49,35 @@ jobs:
|
|
|
cache-dependency-path: '**/yarn.lock'
|
|
|
|
|
|
- name: Cache/Restore node_modules
|
|
|
- id: cache-dependencies
|
|
|
uses: actions/cache@v3
|
|
|
with:
|
|
|
path: |
|
|
|
**/node_modules
|
|
|
- key: node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
|
|
|
+ key: node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('apps/app/package.json') }}
|
|
|
restore-keys: |
|
|
|
+ node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-
|
|
|
node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-
|
|
|
|
|
|
- - name: lerna bootstrap
|
|
|
+ - name: Cache/Restore dist and types
|
|
|
+ uses: actions/cache@v3
|
|
|
+ with:
|
|
|
+ path: |
|
|
|
+ **/dist
|
|
|
+ **/types
|
|
|
+ key: dist-ci-slackbot-proxy-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('node_modules/.cache/turbo/*-meta.json') }}
|
|
|
+ restore-keys: |
|
|
|
+ dist-ci-slackbot-proxy-${{ runner.OS }}-node${{ matrix.node-version }}-
|
|
|
+
|
|
|
+ - name: Install dependencies
|
|
|
run: |
|
|
|
- npx lerna bootstrap -- --frozen-lockfile
|
|
|
+ yarn global add turbo
|
|
|
+ yarn --frozen-lockfile
|
|
|
|
|
|
- name: yarn dev:ci
|
|
|
working-directory: ./apps/slackbot-proxy
|
|
|
run: |
|
|
|
cp config/ci/.env.local.for-ci .env.development.local
|
|
|
- yarn dev:ci
|
|
|
+ turbo run dev:ci
|
|
|
env:
|
|
|
SERVER_URI: http://localhost:8080
|
|
|
TYPEORM_CONNECTION: mysql
|
|
|
@@ -144,7 +103,7 @@ jobs:
|
|
|
|
|
|
strategy:
|
|
|
matrix:
|
|
|
- node-version: [16.x]
|
|
|
+ node-version: [18.x]
|
|
|
|
|
|
services:
|
|
|
mysql:
|
|
|
@@ -165,29 +124,49 @@ jobs:
|
|
|
cache: 'yarn'
|
|
|
cache-dependency-path: '**/yarn.lock'
|
|
|
|
|
|
- - name: Remove unnecessary packages
|
|
|
- working-directory: ./packages
|
|
|
+ - name: Install turbo
|
|
|
run: |
|
|
|
- ls | egrep -v '^(slack|slackbot-proxy)$' | xargs rm -r
|
|
|
- - name: lerna bootstrap
|
|
|
- run: |
|
|
|
- npx lerna bootstrap
|
|
|
- - name: Print dependencies
|
|
|
+ yarn global add turbo
|
|
|
+
|
|
|
+ - name: Prune repositories
|
|
|
run: |
|
|
|
- echo -n "node " && node -v
|
|
|
- echo -n "npm " && npm -v
|
|
|
- yarn list --depth=0
|
|
|
- - name: lerna run build
|
|
|
+ turbo prune --scope=@growi/slackbot-proxy
|
|
|
+ rm -rf apps packages
|
|
|
+ mv out/* .
|
|
|
+
|
|
|
+ - name: Cache/Restore node_modules
|
|
|
+ id: cache-dependencies
|
|
|
+ uses: actions/cache@v3
|
|
|
+ with:
|
|
|
+ path: |
|
|
|
+ **/node_modules
|
|
|
+ key: node_modules-slackbot-prxy-build-prod-${{ runner.OS }}-node${{ inputs.node-version }}-${{ hashFiles('**/yarn.lock') }}
|
|
|
+ restore-keys: |
|
|
|
+ node_modules-slackbot-proxy-build-prod-${{ runner.OS }}-node${{ inputs.node-version }}-
|
|
|
+
|
|
|
+ - name: Install dependencies
|
|
|
run: |
|
|
|
- yarn lerna run build
|
|
|
- - name: lerna bootstrap --production
|
|
|
+ yarn --frozen-lockfile
|
|
|
+
|
|
|
+ - name: Cache/Restore dist and types
|
|
|
+ uses: actions/cache@v3
|
|
|
+ with:
|
|
|
+ path: |
|
|
|
+ **/dist
|
|
|
+ **/types
|
|
|
+ key: dist-slackbot-proxy-prod-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('node_modules/.cache/turbo/*-meta.json') }}
|
|
|
+ restore-keys: |
|
|
|
+ dist-slackbot-proxy-prod-${{ runner.OS }}-node${{ matrix.node-version }}-
|
|
|
+
|
|
|
+ - name: Build
|
|
|
+ working-directory: ./apps/slackbot-proxy
|
|
|
run: |
|
|
|
- npx lerna bootstrap -- --production
|
|
|
- - name: Print dependencies
|
|
|
+ turbo run build
|
|
|
+
|
|
|
+ - name: Install dependencies for production
|
|
|
run: |
|
|
|
- echo -n "node " && node -v
|
|
|
- echo -n "npm " && npm -v
|
|
|
- yarn list --production --depth=0
|
|
|
+ yarn --production
|
|
|
+
|
|
|
- name: yarn start:prod:ci
|
|
|
working-directory: ./apps/slackbot-proxy
|
|
|
run: |
|