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: Upgrade turbo to v2 #8875

Merged
merged 3 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 32 additions & 51 deletions .github/workflows/ci-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,23 @@ jobs:
with:
path: |
**/node_modules
key: node_modules-7.x-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('apps/app/package.json') }}
!**/node_modules/.cache/turbo
key: node_modules-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-${{ github.ref_name }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
node_modules-7.x-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-
node_modules-7.x-${{ runner.OS }}-node${{ matrix.node-version }}-
node_modules-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-${{ github.ref_name }}-
node_modules-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-

- name: Restore dist
uses: actions/cache/restore@v4
- name: Cache/Restore dist
uses: actions/cache@v4
with:
path: |
**/.turbo
**/dist
key: dist-app-7.x-ci-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('node_modules/.cache/turbo/*-meta.json') }}
**/node_modules/.cache/turbo
key: dist-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-${{ github.ref_name }}-${{ github.sha }}
restore-keys: |
dist-app-7.x-ci-${{ runner.OS }}-node${{ matrix.node-version }}-
dist-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-${{ github.ref_name }}-
dist-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-

- name: Install dependencies
run: |
Expand All @@ -78,14 +81,6 @@ jobs:
isCompactMode: true
url: ${{ secrets.SLACK_WEBHOOK_URL }}

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


ci-app-test:
runs-on: ubuntu-latest
Expand All @@ -110,25 +105,27 @@ jobs:
cache-dependency-path: '**/yarn.lock'

- name: Cache/Restore node_modules
id: cache-dependencies
uses: actions/cache@v4
with:
path: |
**/node_modules
key: node_modules-7.x-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('apps/app/package.json') }}
!**/node_modules/.cache/turbo
key: node_modules-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-${{ github.ref_name }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
node_modules-7.x-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-
node_modules-7.x-${{ runner.OS }}-node${{ matrix.node-version }}-
node_modules-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-${{ github.ref_name }}-
node_modules-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-

- name: Restore dist
uses: actions/cache/restore@v4
- name: Cache/Restore dist
uses: actions/cache@v4
with:
path: |
**/.turbo
**/dist
key: dist-app-7.x-ci-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('node_modules/.cache/turbo/*-meta.json') }}
**/node_modules/.cache/turbo
key: dist-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-${{ github.ref_name }}-${{ github.sha }}
restore-keys: |
dist-app-7.x-ci-${{ runner.OS }}-node${{ matrix.node-version }}-
dist-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-${{ github.ref_name }}-
dist-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-

- name: Install dependencies
run: |
Expand All @@ -138,7 +135,7 @@ jobs:

- name: Test
run: |
turbo run test --filter=!@growi/slackbot-proxy
turbo run test --filter=!@growi/slackbot-proxy --env-mode=loose
env:
MONGO_URI: mongodb://localhost:${{ job.services.mongodb.ports['27017'] }}/growi_test

Expand All @@ -160,14 +157,6 @@ jobs:
isCompactMode: true
url: ${{ secrets.SLACK_WEBHOOK_URL }}

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


ci-app-launch-dev:
runs-on: ubuntu-latest
Expand All @@ -192,26 +181,27 @@ jobs:
cache-dependency-path: '**/yarn.lock'

- name: Cache/Restore node_modules
id: cache-dependencies
uses: actions/cache@v4
with:
path: |
**/node_modules
key: node_modules-7.x-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('apps/app/package.json') }}
!**/node_modules/.cache/turbo
key: node_modules-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-${{ github.ref_name }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
node_modules-7.x-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-
node_modules-7.x-${{ runner.OS }}-node${{ matrix.node-version }}-
node_modules-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-${{ github.ref_name }}-
node_modules-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-

- name: Restore dist
uses: actions/cache/restore@v4
- name: Cache/Restore dist
uses: actions/cache@v4
with:
path: |
**/.turbo
**/dist
${{ github.workspace }}/apps/app/.next
key: dist-app-7.x-dev-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('node_modules/.cache/turbo/*-meta.json') }}
**/node_modules/.cache/turbo
key: dist-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-${{ github.ref_name }}-${{ github.sha }}
restore-keys: |
dist-app-7.x-dev-${{ runner.OS }}-node${{ matrix.node-version }}-
dist-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-${{ github.ref_name }}-
dist-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-

- name: Install dependencies
run: |
Expand All @@ -223,7 +213,7 @@ jobs:
working-directory: ./apps/app
run: |
cp config/ci/.env.local.for-ci .env.development.local
turbo run dev:ci
turbo run dev:ci --env-mode=loose
env:
MONGO_URI: mongodb://localhost:${{ job.services.mongodb.ports['27017'] }}/growi_dev

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

- name: Cache dist
uses: actions/cache/save@v4
with:
path: |
**/.turbo
**/dist
${{ github.workspace }}/apps/app/.next
key: dist-app-7.x-dev-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('node_modules/.cache/turbo/*-meta.json') }}
4 changes: 2 additions & 2 deletions .github/workflows/ci-slackbot-proxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ jobs:
working-directory: ./apps/slackbot-proxy
run: |
cp config/ci/.env.local.for-ci .env.development.local
turbo run dev:ci
turbo run dev:ci --env-mode=loose
env:
SERVER_URI: http://localhost:8080
TYPEORM_CONNECTION: mysql
Expand Down Expand Up @@ -206,7 +206,7 @@ jobs:

- name: Prune repositories
run: |
turbo prune --scope=@growi/slackbot-proxy
turbo prune @growi/slackbot-proxy
rm -rf apps packages
mv out/* .

Expand Down
64 changes: 29 additions & 35 deletions .github/workflows/reusable-app-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,37 +43,38 @@ jobs:

- name: Prune repositories
run: |
turbo prune --scope=@growi/app
turbo prune @growi/app
rm -rf apps packages
mv out/* .

- name: Cache/Restore node_modules
id: cache-dependencies
uses: actions/cache@v4
with:
path: |
**/node_modules
key: node_modules-app-build-prod-${{ runner.OS }}-node${{ inputs.node-version }}-${{ hashFiles('**/yarn.lock') }}
!**/node_modules/.cache/turbo
key: node_modules-app-build-prod-${{ runner.OS }}-node${{ inputs.node-version }}-${{ github.ref_name }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
node_modules-app-build-prod-${{ runner.OS }}-node${{ inputs.node-version }}-${{ github.ref_name }}-
node_modules-app-build-prod-${{ runner.OS }}-node${{ inputs.node-version }}-

- name: Install dependencies
run: |
yarn global add node-gyp
yarn --frozen-lockfile

- name: Restore dist
- name: Cache/Restore dist
uses: actions/cache@v4
with:
path: |
node_modules/.cache/turbo
**/.turbo
**/dist
**/node_modules/.cache/turbo
${{ github.workspace }}/apps/app/.next
key: dist-app-7.x-prod-${{ runner.OS }}-node${{ inputs.node-version }}-${{ github.ref_name }}-${{ github.sha }}
key: dist-app-prod-${{ runner.OS }}-node${{ inputs.node-version }}-${{ github.ref_name }}-${{ github.sha }}
restore-keys: |
dist-app-7.x-prod-${{ runner.OS }}-node${{ inputs.node-version }}-${{ github.ref_name }}-
dist-app-7.x-prod-${{ runner.OS }}-node${{ inputs.node-version }}-
dist-app-prod-${{ runner.OS }}-node${{ inputs.node-version }}-${{ github.ref_name }}-
dist-app-prod-${{ runner.OS }}-node${{ inputs.node-version }}-

- name: Build
working-directory: ./apps/app
Expand Down Expand Up @@ -155,19 +156,20 @@ jobs:

- name: Prune repositories
run: |
turbo prune --scope=@growi/app
turbo prune @growi/app
rm -rf apps packages
mv out/* .

- name: Cache/Restore node_modules
id: cache-dependencies
uses: actions/cache@v4
- name: Restore node_modules
uses: actions/cache/restore@v4
with:
path: |
**/node_modules
key: node_modules-app-7.x-launch-prod-${{ runner.OS }}-node${{ inputs.node-version }}-${{ hashFiles('**/yarn.lock') }}
# shared key with build-prod
key: node_modules-app-build-prod-${{ runner.OS }}-node${{ inputs.node-version }}-${{ github.ref_name }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
node_modules-app-7.x-launch-prod-${{ runner.OS }}-node${{ inputs.node-version }}-
node_modules-app-build-prod-${{ runner.OS }}-node${{ inputs.node-version }}-${{ github.ref_name }}-
node_modules-app-build-prod-${{ runner.OS }}-node${{ inputs.node-version }}-

- name: Install dependencies
run: |
Expand Down Expand Up @@ -246,19 +248,20 @@ jobs:

- name: Prune repositories
run: |
turbo prune --scope=@growi/app
turbo prune @growi/app
rm -rf apps packages
mv out/* .

- name: Cache/Restore node_modules
id: cache-dependencies
uses: actions/cache@v4
- name: Restore node_modules
uses: actions/cache/restore@v4
with:
path: |
**/node_modules
key: node_modules-app-build-prod-${{ runner.OS }}-node${{ inputs.node-version }}-${{ hashFiles('**/yarn.lock') }}
# shared key with ci-app.yml
key: node_modules-ci-app-${{ runner.OS }}-node${{ inputs.node-version }}-${{ github.ref_name }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
node_modules-app-build-prod-${{ runner.OS }}-node${{ inputs.node-version }}-
node_modules-ci-app-${{ runner.OS }}-node${{ inputs.node-version }}-${{ github.ref_name }}-
node_modules-ci-app-${{ runner.OS }}-node${{ inputs.node-version }}-

- name: Cache/Restore Cypress files
uses: actions/cache@v4
Expand Down Expand Up @@ -376,25 +379,16 @@ jobs:
cache: 'yarn'
cache-dependency-path: '**/yarn.lock'

- name: Install turbo
run: |
yarn global add turbo

- name: Prune repositories
run: |
turbo prune --scope=@growi/app
rm -rf apps packages
mv out/* .

- name: Cache/Restore node_modules
id: cache-dependencies
uses: actions/cache@v4
- name: Restore node_modules
uses: actions/cache/restore@v4
with:
path: |
**/node_modules
key: node_modules-app-build-prod-${{ runner.OS }}-node${{ inputs.node-version }}-${{ hashFiles('**/yarn.lock') }}
# shared key with ci-app.yml
key: node_modules-ci-app-${{ runner.OS }}-node${{ inputs.node-version }}-${{ github.ref_name }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
node_modules-app-build-prod-${{ runner.OS }}-node${{ inputs.node-version }}-
node_modules-ci-app-${{ runner.OS }}-node${{ inputs.node-version }}-${{ github.ref_name }}-
node_modules-ci-app-${{ runner.OS }}-node${{ inputs.node-version }}-

- name: Cache/Restore Playwright files
uses: actions/cache@v4
Expand Down
21 changes: 6 additions & 15 deletions .github/workflows/reusable-app-reg-suit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,25 +60,16 @@ jobs:
cache: 'yarn'
cache-dependency-path: '**/yarn.lock'

- name: Install turbo
run: |
yarn global add turbo

- name: Prune repositories
run: |
turbo prune --scope=@growi/app
rm -rf apps packages
mv out/* .

- name: Cache/Restore node_modules
id: cache-dependencies
uses: actions/cache@v4
- name: Restore node_modules
uses: actions/cache/restore@v4
with:
path: |
**/node_modules
key: node_modules-7.x-${{ runner.OS }}-node${{ inputs.node-version }}-${{ hashFiles('**/yarn.lock') }}
# shared key with ci-app.yml
key: node_modules-ci-app-${{ runner.OS }}-node${{ inputs.node-version }}-${{ github.ref_name }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
node_modules-7.x-${{ runner.OS }}-node${{ inputs.node-version }}-
node_modules-ci-app-${{ runner.OS }}-node${{ inputs.node-version }}-${{ github.ref_name }}-
node_modules-ci-app-${{ runner.OS }}-node${{ inputs.node-version }}-

- name: Install dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion apps/app/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ WORKDIR ${optDir}

RUN yarn global add turbo
COPY . .
RUN turbo prune --scope=@growi/app --docker
RUN turbo prune @growi/app --docker


##
Expand Down
Loading
Loading