Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support: Migrate to Turborepo #7417

Merged
merged 179 commits into from
Apr 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
179 commits
Select commit Hold shift + click to select a range
0b8d794
upgrade middlewares
yuki-takei Feb 14, 2023
0007713
upgrade openid-client
yuki-takei Feb 14, 2023
e3402c2
remove lerna.json and add turbo
yuki-takei Feb 14, 2023
90100ef
move slackbot-proxy under apps
yuki-takei Feb 14, 2023
d729a4d
move app under apps
yuki-takei Feb 14, 2023
13bd034
clean .gitignore
yuki-takei Feb 14, 2023
a96ff9a
upgrade tools
yuki-takei Feb 14, 2023
eb6f3e0
move tests dir
yuki-takei Feb 14, 2023
68344cf
use swc for test
yuki-takei Feb 14, 2023
df9301c
build @growi/core with vite
yuki-takei Feb 14, 2023
98b7338
refactor env-utils.js
yuki-takei Feb 14, 2023
2e9f6a0
typescriptize
yuki-takei Feb 14, 2023
e5a1ed5
typescriptize
yuki-takei Feb 14, 2023
e29e401
build @growi/core with vite
yuki-takei Feb 14, 2023
9859c32
add turbo.json
yuki-takei Feb 14, 2023
99f82bd
WIP: import preset-themes prebuilt
yuki-takei Feb 14, 2023
a9436ba
add dev:types script
yuki-takei Feb 14, 2023
85c35c7
update turbo.json
yuki-takei Feb 14, 2023
842f32e
Merge branch 'master' into support/use-turborepo
yuki-takei Feb 16, 2023
20cccb9
improve scripts
yuki-takei Feb 16, 2023
abfe185
add vite plugins
yuki-takei Feb 16, 2023
c5e4f1e
transpile with vite
yuki-takei Feb 16, 2023
6791f59
activate reveal
yuki-takei Feb 16, 2023
47ccd71
exclude react-markdown
yuki-takei Feb 16, 2023
75d3a66
activate next/head
yuki-takei Feb 16, 2023
a27006f
activate marp by excluding from @growi/presentation
yuki-takei Feb 16, 2023
e448838
exclude reveal.js
yuki-takei Feb 16, 2023
e061d6b
apply vite-plugin-dts
yuki-takei Feb 16, 2023
9927e36
clean code
yuki-takei Feb 16, 2023
44e6921
clean preset-themes
yuki-takei Feb 16, 2023
4667e82
add $schema lines
yuki-takei Feb 16, 2023
066c48f
update scripts
yuki-takei Feb 21, 2023
68e551d
update bump-versions.config.js
yuki-takei Feb 21, 2023
f4db8c9
remove rimraf
yuki-takei Feb 21, 2023
5614f88
fix lint errors
yuki-takei Feb 21, 2023
5585484
rewrite ci-app.yml for turbo
yuki-takei Feb 21, 2023
9f99435
optimize import lines
yuki-takei Feb 21, 2023
1f77029
build @growi/slack with vite
yuki-takei Feb 21, 2023
822f7a4
improve import lines
yuki-takei Feb 21, 2023
81201eb
Merge remote-tracking branch 'origin/master' into support/use-turborepo
yuki-takei Feb 21, 2023
e47f00a
run db migration with turbo
yuki-takei Feb 21, 2023
219bc7b
WIP: update workflow
yuki-takei Feb 21, 2023
90f964a
replace packages/app -> apps/app
yuki-takei Feb 21, 2023
611d93e
replace packages/slackbot-proxy -> apps/slackbot-proxy
yuki-takei Feb 21, 2023
a7f978a
cache/restore dist and types
yuki-takei Feb 21, 2023
d92adbb
remove test scripts that are not valid
yuki-takei Feb 22, 2023
85bc75a
fix test
yuki-takei Feb 22, 2023
f255b26
reorganize hackmd scripts
yuki-takei Feb 22, 2023
c8508d2
build @growi/hackmd with vite
yuki-takei Feb 22, 2023
5b65662
typescriptize
yuki-takei Feb 22, 2023
f164f69
fix lint settings
yuki-takei Feb 22, 2023
1e025ad
fix test settings
yuki-takei Feb 22, 2023
7db7c7d
update uses line
yuki-takei Feb 22, 2023
b7649fc
Merge remote-tracking branch 'origin/master' into support/use-turborepo
yuki-takei Feb 24, 2023
df2809a
update workflows for prod
yuki-takei Feb 24, 2023
5aeb23f
reorganize core
yuki-takei Feb 24, 2023
bf4378f
import core utils independently
yuki-takei Feb 24, 2023
cbbd7fb
update workflows
yuki-takei Feb 24, 2023
c217092
fix module name mapping for test
yuki-takei Feb 24, 2023
153d1a0
update .eslintignore for sub-packages
yuki-takei Feb 24, 2023
eb54f20
fix directory structure
yuki-takei Feb 24, 2023
54a6696
remove vite-env.d.ts
yuki-takei Feb 24, 2023
e21d71b
Merge remote-tracking branch 'origin/master' into support/use-turborepo
yuki-takei Feb 24, 2023
e6e5b48
fix configurations for production build
yuki-takei Feb 24, 2023
bcd4502
fix configurations for production build
yuki-takei Feb 24, 2023
321ec9f
fix pipeline
yuki-takei Feb 24, 2023
228cc9f
fix tsconfig for dev:migrate
yuki-takei Feb 24, 2023
84363b2
fix Archive production files step
yuki-takei Feb 24, 2023
9070d20
update jest settings
yuki-takei Feb 24, 2023
f77a823
use swc for test
yuki-takei Feb 24, 2023
cf3903d
clean config
yuki-takei Feb 24, 2023
f172bfb
clean code
yuki-takei Feb 24, 2023
e535fd4
build remark-lsx with vite
yuki-takei Feb 25, 2023
b6d6753
fix watch scripts
yuki-takei Feb 25, 2023
a944505
Merge remote-tracking branch 'origin/master' into support/use-turborepo
yuki-takei Mar 2, 2023
9338eb5
Merge branch 'support/use-turborepo' into support/build-remark-lsx-wi…
yuki-takei Mar 2, 2023
efae29f
separate builds for server and client
yuki-takei Mar 2, 2023
f9be074
fix lsx styles
yuki-takei Mar 2, 2023
cdd6d5f
reorganize renderer
yuki-takei Mar 2, 2023
ff0f35a
clean code
yuki-takei Mar 2, 2023
f290ba5
typescriptize
yuki-takei Mar 3, 2023
4374bda
build @growi/ui with vite
yuki-takei Mar 3, 2023
5d0bba1
fix import lines for @growi/ui
yuki-takei Mar 3, 2023
d4e00c0
move _page_list.scss under @growi/ui
yuki-takei Mar 3, 2023
921b9e4
update jest.config.js
yuki-takei Mar 3, 2023
03f17ac
fix register renderer options
yuki-takei Mar 3, 2023
96e31f5
Merge pull request #7452 from weseek/support/build-remark-lsx-with-vite
yuki-takei Mar 3, 2023
6ef4d3e
fix null checking in activate-plugin
yuki-takei Mar 5, 2023
3cd21ab
use swc-node/register
yuki-takei Mar 5, 2023
d797083
reorganize packages
yuki-takei Mar 5, 2023
182ebd2
add pipeline for @growi/slackbot-proxy#dev:ci
yuki-takei Mar 5, 2023
0c1633b
fix lint errors
yuki-takei Mar 5, 2023
37a5b23
clean workflow
yuki-takei Mar 5, 2023
b052dfe
update workflow settings
yuki-takei Mar 5, 2023
417450c
fix import errors
yuki-takei Mar 5, 2023
cd123a7
build type files to dist dir
yuki-takei Mar 5, 2023
d4a91e3
add dev script to remark-growi-directive
yuki-takei Mar 5, 2023
e08e1df
fix type errors
yuki-takei Mar 5, 2023
1d6851a
change ext to cjs
yuki-takei Mar 5, 2023
c8cb2b7
revert types properties
yuki-takei Mar 5, 2023
0e455f0
update cache settings for workflows
yuki-takei Mar 5, 2023
4590f9a
fix dev:ci script
yuki-takei Mar 5, 2023
577f7d4
add yargs as procudtion dependencies
yuki-takei Mar 5, 2023
6301f56
update turbo.json
yuki-takei Mar 5, 2023
299bb87
fix lint errors
yuki-takei Mar 5, 2023
66e51e7
fix workflow
yuki-takei Mar 5, 2023
ff510df
bump @typescript-eslint
yuki-takei Mar 5, 2023
00b6984
add lint job
yuki-takei Mar 5, 2023
12e5cae
update .eslintrc.js
yuki-takei Mar 5, 2023
0e5da20
update ci settings
yuki-takei Mar 5, 2023
51726d8
fix indent
yuki-takei Mar 5, 2023
3b4fc24
update dependencies
yuki-takei Mar 5, 2023
32b66fc
use "yarn eslint"
yuki-takei Mar 5, 2023
30eadda
Merge remote-tracking branch 'origin/master' into support/use-turborepo
yuki-takei Mar 6, 2023
1e1d134
Show eslint version
yuki-takei Mar 6, 2023
753f6dc
clean workflow file
yuki-takei Mar 6, 2023
2d045c0
use escape-string-regexp@^4.0.0
yuki-takei Mar 6, 2023
f185b98
set --emptyOutDir=false
yuki-takei Mar 6, 2023
bde2b5f
add ts-node-dev as a global dependency
yuki-takei Mar 6, 2023
0363889
use ts-node-dev with swc option
yuki-takei Mar 6, 2023
a4ef1c2
reorganize tsconfig.json
yuki-takei Mar 6, 2023
a19fdcd
BugFix for generatePreviewOptions
yuki-takei Mar 6, 2023
3b99c30
fix pipeline
yuki-takei Mar 6, 2023
93e620d
fix tsconfig
yuki-takei Mar 6, 2023
91aba80
remove container_name for devcontainer
yuki-takei Mar 13, 2023
44eb524
update turbo.json
yuki-takei Mar 13, 2023
073b2b1
omit @extend line
yuki-takei Mar 13, 2023
d094343
Merge remote-tracking branch 'origin/master' into support/use-turborepo
yuki-takei Mar 14, 2023
56ff666
update yarn.lock
yuki-takei Mar 14, 2023
44cc5b4
WIP: add vite.styles-prebuilt.config.ts
yuki-takei Mar 14, 2023
63fc589
extract sourcemap for prebuilt packages
yuki-takei Mar 16, 2023
cbba314
reorganize getTranspilePackages
yuki-takei Mar 16, 2023
640dd72
Merge remote-tracking branch 'origin/support/use-turborepo' into supp…
yuki-takei Mar 16, 2023
68e9e25
build styles-prebuilt with turbo
yuki-takei Mar 16, 2023
79faf6e
update turbo.json
yuki-takei Mar 16, 2023
dabd081
Merge pull request #7490 from weseek/support/prebuild-css-with-vite
yuki-takei Mar 16, 2023
02746b5
Merge remote-tracking branch 'origin/master' into support/use-turborepo
yuki-takei Mar 16, 2023
6421dac
relocate d.ts
yuki-takei Mar 16, 2023
d95efba
update source-map-loader settings
yuki-takei Mar 16, 2023
b6852c0
relocate importing lib styles into component modules
yuki-takei Mar 16, 2023
75ab09c
cache and restore .turbo dir
yuki-takei Mar 16, 2023
bf0c579
fix turbo.json
yuki-takei Mar 16, 2023
6d63ae6
update ci-app-prod.yml
yuki-takei Mar 16, 2023
b65cdfd
update turbo.json
yuki-takei Mar 16, 2023
12a8cc8
convert SlackbotType to const from enum
yuki-takei Mar 16, 2023
8380cad
Merge remote-tracking branch 'origin/master' into support/use-turborepo
yuki-takei Mar 23, 2023
2c65c9d
delete prebuild:client script
yuki-takei Mar 23, 2023
54edc4c
convert to js
yuki-takei Mar 23, 2023
ea6f231
convert to js
yuki-takei Mar 23, 2023
9c6072c
improve import line
yuki-takei Mar 23, 2023
0a8899b
Merge remote-tracking branch 'origin/master' into support/use-turborepo
yuki-takei Apr 10, 2023
b71e25c
divide import
yuki-takei Apr 10, 2023
1849caf
import remark-lsx styles
yuki-takei Apr 11, 2023
5773476
add customGenerater into deps
yuki-takei Apr 11, 2023
0e33e78
refactor importing plugin modules
yuki-takei Apr 11, 2023
555c6a1
Merge remote-tracking branch 'origin/master' into support/use-turborepo
yuki-takei Apr 12, 2023
7625656
WIP: rewrite Dockerfile with turbo prune
yuki-takei Apr 12, 2023
844037d
add bootstrap script
yuki-takei Apr 12, 2023
41d0207
remove unnecessary import line
yuki-takei Apr 12, 2023
777e01d
refactor rate-limiter with feature pattern
yuki-takei Apr 12, 2023
8fe88d7
update postbuild:server
yuki-takei Apr 12, 2023
9b2755b
build remark-drawio with vite
yuki-takei Apr 12, 2023
023e0ab
remove paths for sub packages
yuki-takei Apr 12, 2023
a854d6a
enable sourcemap
yuki-takei Apr 12, 2023
21e72bb
update bootstrap script
yuki-takei Apr 12, 2023
73539b6
upgrade eslint-config-weseek
yuki-takei Apr 12, 2023
d1ce4c8
add script for type checking
yuki-takei Apr 12, 2023
07bab27
update cache settings
yuki-takei Apr 14, 2023
3ecd3ab
update cache settings
yuki-takei Apr 14, 2023
321ef19
fix label
yuki-takei Apr 14, 2023
195dc8e
Merge remote-tracking branch 'origin/master' into support/use-turborepo
yuki-takei Apr 14, 2023
f589f98
Merge branch 'master' into support/use-turborepo
yuki-takei Apr 14, 2023
8bb26bc
improve the link to the docs for slack integration
yuki-takei Apr 14, 2023
d26e206
refactor transpile settings for @growi/slack
yuki-takei Apr 14, 2023
c008ee0
support new @growi/slack
yuki-takei Apr 14, 2023
61f5db4
support new @growi/slack
yuki-takei Apr 14, 2023
e642fca
fix postbuild:server
yuki-takei Apr 14, 2023
4d67293
set install-command: yarn --production
yuki-takei Apr 14, 2023
ac7096b
remove install-command and use node_modules cache for build-prod
yuki-takei Apr 14, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 4 additions & 5 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
#-------------------------------------------------------------------------------------------------------------

FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-16
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-18

# The node image includes a non-root user with sudo access. Use the
# "remoteUser" property in devcontainer.json to use it. On Linux, update
Expand All @@ -14,9 +14,9 @@ ARG USER_UID=1000
ARG USER_GID=$USER_UID

RUN mkdir -p /workspace/growi/node_modules
RUN mkdir -p /workspace/growi/packages/app/node_modules
RUN mkdir -p /workspace/growi/packages/slackbot-proxy/node_modules
RUN mkdir -p /workspace/growi/packages/app/.next
RUN mkdir -p /workspace/growi/apps/app/node_modules
RUN mkdir -p /workspace/growi/apps/slackbot-proxy/node_modules
RUN mkdir -p /workspace/growi/apps/app/.next

# [Optional] Update UID/GID if needed
RUN if [ "$USER_GID" != "1000" ] || [ "$USER_UID" != "1000" ]; then \
Expand All @@ -42,7 +42,6 @@ RUN apt-get update \
google-chrome-stable \
# for Cypress
libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb fonts-noto-cjk \

# Clean up
&& apt-get autoremove -y \
&& apt-get clean -y \
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
// "shutdownAction": "none",

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "yarn install",
"postCreateCommand": "yarn global add turbo && yarn install",

// Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "node"
Expand Down
10 changes: 5 additions & 5 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ services:
volumes:
- ..:/workspace/growi:delegated
- node_modules:/workspace/growi/node_modules
- node_modules_app:/workspace/growi/packages/app/node_modules
- node_modules_slackbot-proxy:/workspace/growi/packages/slackbot-proxy/node_modules
- buildcache_app:/workspace/growi/packages/app/.next
- node_modules_app:/workspace/growi/apps/app/node_modules
- node_modules_slackbot-proxy:/workspace/growi/apps/slackbot-proxy/node_modules
- buildcache_app:/workspace/growi/apps/app/.next
- ../../growi-docker-compose:/workspace/growi-docker-compose:delegated

tty: true
Expand All @@ -49,7 +49,7 @@ services:
context: ../../growi-docker-compose/elasticsearch
dockerfile: ./Dockerfile
args:
- version=7.16.1
- version=7.17.9
restart: unless-stopped
ports:
- 9200:9200
Expand All @@ -67,7 +67,7 @@ services:

#need to adjust kibana version based on elasticsearch version (use same version as elasticsearch version)
kibana:
image: docker.elastic.co/kibana/kibana:7.16.1
image: docker.elastic.co/kibana/kibana:7.17.9
restart: unless-stopped
environment:
ELASTICSEARCH_HOSTS: 'http://elasticsearch:9200'
Expand Down
30 changes: 16 additions & 14 deletions .github/workflows/ci-app-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ on:
- .github/workflows/reusable-app-prod.yml
- .github/workflows/reusable-app-reg-suit.yml
- tsconfig.base.json
- turbo.json
- yarn.lock
- packages/app/**
- '!packages/app/docker/**'
- apps/app/**
- '!apps/app/docker/**'
- packages/codemirror-textlint/**
- packages/core/**
- packages/preset-themes/**
Expand All @@ -29,8 +30,9 @@ on:
- .github/workflows/reusable-app-reg-suit.yml
- tsconfig.base.json
- yarn.lock
- packages/app/**
- '!packages/app/docker/**'
- turbo.json
- apps/app/**
- '!apps/app/docker/**'
- packages/codemirror-textlint/**
- packages/core/**
- packages/preset-themes/**
Expand All @@ -51,35 +53,35 @@ concurrency:

jobs:

test-prod-node14:
uses: weseek/growi/.github/workflows/reusable-app-prod.yml@master
test-prod-node16:
uses: weseek/growi/.github/workflows/reusable-app-prod.yml@support/use-turborepo
with:
node-version: 14.x
node-version: 16.x
skip-cypress: true
secrets:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}


test-prod-node16:
uses: weseek/growi/.github/workflows/reusable-app-prod.yml@master
test-prod-node18:
uses: weseek/growi/.github/workflows/reusable-app-prod.yml@support/use-turborepo
with:
node-version: 16.x
node-version: 18.x
skip-cypress: ${{ contains( github.event.pull_request.labels.*.name, 'dependencies' ) }}
cypress-report-artifact-name: Cypress report
cypress-config-video: ${{ inputs.cypress-config-video || false }}
secrets:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}


run-reg-suit-node16:
needs: [test-prod-node16]
run-reg-suit-node18:
needs: [test-prod-node18]

uses: weseek/growi/.github/workflows/reusable-app-reg-suit.yml@master
uses: weseek/growi/.github/workflows/reusable-app-reg-suit.yml@support/use-turborepo

if: always()

with:
node-version: 16.x
node-version: 18.x
skip-reg-suit: ${{ contains( github.event.pull_request.labels.*.name, 'dependencies' ) }}
cypress-report-artifact-name: Cypress report
secrets:
Expand Down
126 changes: 88 additions & 38 deletions .github/workflows/ci-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ on:
- .github/workflows/ci-app.yml
- .eslint*
- tsconfig.base.json
- turbo.json
- yarn.lock
- packages/app/**
- '!packages/app/docker/**'
- apps/app/**
- '!apps/app/docker/**'
- packages/codemirror-textlint/**
- packages/core/**
- packages/preset-themes/**
- packages/hackmd/**
- packages/presentation/**
- packages/preset-themes/**
- packages/remark-*/**
- packages/slack/**
- packages/ui/**
Expand All @@ -31,7 +33,7 @@ jobs:

strategy:
matrix:
node-version: [16.x]
node-version: [18.x]

steps:
- uses: actions/checkout@v3
Expand All @@ -43,29 +45,33 @@ 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') }}-${{ hashFiles('packages/app/package.json') }}
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
run: |
npx lerna bootstrap -- --frozen-lockfile
- name: Restore dist
uses: actions/cache/restore@v3
with:
path: |
**/.turbo
**/dist
key: dist-app-ci-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('node_modules/.cache/turbo/*-meta.json') }}
restore-keys: |
dist-app-ci-${{ runner.OS }}-node${{ matrix.node-version }}-

- name: lerna run lint for dependent packages
run: |
yarn lerna run lint --scope @growi/codemirror-textlint --scope @growi/core --scope @growi/hackmd --scope @growi/preset-themes --scope @growi/remark-* --scope @growi/slack --scope @growi/ui
- name: build dependent packages
- name: Install dependencies
run: |
yarn lerna run build --scope @growi/preset-themes
- name: lerna run lint for app
yarn global add turbo
yarn --frozen-lockfile

- name: Lint
run: |
yarn lerna run lint --scope @growi/app
turbo run lint --filter=!@growi/slackbot-proxy

- name: Slack Notification
uses: weseek/ghaction-slack-notification@master
Expand All @@ -77,12 +83,21 @@ jobs:
isCompactMode: true
url: ${{ secrets.SLACK_WEBHOOK_URL }}

- name: Cache dist
uses: actions/cache/save@v3
with:
path: |
**/.turbo
**/dist
key: dist-app-ci-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('node_modules/.cache/turbo/*-meta.json') }}


test:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]
node-version: [18.x]

services:
mongodb:
Expand All @@ -105,23 +120,29 @@ jobs:
with:
path: |
**/node_modules
key: node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('packages/app/package.json') }}
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
run: |
npx lerna bootstrap -- --frozen-lockfile
- name: Restore dist
uses: actions/cache/restore@v3
with:
path: |
**/.turbo
**/dist
key: dist-app-ci-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('node_modules/.cache/turbo/*-meta.json') }}
restore-keys: |
dist-app-ci-${{ runner.OS }}-node${{ matrix.node-version }}-

- name: lerna run test for plugins
- name: Install dependencies
run: |
yarn lerna run test --scope @growi/remark-*
yarn global add turbo
yarn --frozen-lockfile

- name: Test app
working-directory: ./packages/app
- name: Test
run: |
yarn test:ci --selectProjects unit server ; yarn test:ci --selectProjects server-v5
turbo run test --filter=!@growi/slackbot-proxy
env:
MONGO_URI: mongodb://localhost:${{ job.services.mongodb.ports['27017'] }}/growi_test

Expand All @@ -130,7 +151,7 @@ jobs:
with:
name: Coverage Report
path: |
packages/app/coverage
apps/app/coverage
packages/remark-growi-directive/coverage

- name: Slack Notification
Expand All @@ -143,12 +164,21 @@ jobs:
isCompactMode: true
url: ${{ secrets.SLACK_WEBHOOK_URL }}

- name: Cache dist
uses: actions/cache/save@v3
with:
path: |
**/.turbo
**/dist
key: dist-app-ci-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('node_modules/.cache/turbo/*-meta.json') }}


launch-dev:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]
node-version: [18.x]

services:
mongodb:
Expand All @@ -165,27 +195,38 @@ jobs:
cache: 'yarn'
cache-dependency-path: '**/yarn.lock'

- name: Cache/Restore node_modules and next cache files
- name: Cache/Restore node_modules
id: cache-dependencies
uses: actions/cache@v3
with:
path: |
**/node_modules
${{ github.workspace }}/packages/app/.next/cache
key: dev-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('packages/app/package.json') }}
key: node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('apps/app/package.json') }}
restore-keys: |
dev-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-
dev-${{ runner.OS }}-node${{ matrix.node-version }}-
node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-
node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-

- name: lerna bootstrap
- name: Restore dist
uses: actions/cache/restore@v3
with:
path: |
**/.turbo
**/dist
${{ github.workspace }}/apps/app/.next
key: dist-app-dev-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('node_modules/.cache/turbo/*-meta.json') }}
restore-keys: |
dist-app-dev-${{ 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: ./packages/app
- name: turbo run dev:ci
working-directory: ./apps/app
run: |
cp config/ci/.env.local.for-ci .env.development.local
yarn dev:ci
turbo run dev:ci
env:
MONGO_URI: mongodb://localhost:${{ job.services.mongodb.ports['27017'] }}/growi_dev

Expand All @@ -198,3 +239,12 @@ jobs:
channel: '#ci'
isCompactMode: true
url: ${{ secrets.SLACK_WEBHOOK_URL }}

- name: Cache dist
uses: actions/cache/save@v3
with:
path: |
**/.turbo
**/dist
${{ github.workspace }}/apps/app/.next
key: dist-app-dev-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('node_modules/.cache/turbo/*-meta.json') }}