mirror of
https://github.com/beekeeper-studio/beekeeper-studio.git
synced 2026-03-13 10:12:54 +08:00
ci: cache node_modules across CI builds
Use actions/cache to cache all three node_modules directories (root, apps/studio, apps/ui-kit) keyed on OS and yarn.lock hash. Skip yarn install when cache hits. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -89,10 +89,18 @@ jobs:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: yarn
|
||||
|
||||
- name: Clean cache
|
||||
run: yarn cache clean
|
||||
- name: Cache node_modules
|
||||
id: cache-node-modules
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
node_modules
|
||||
apps/studio/node_modules
|
||||
apps/ui-kit/node_modules
|
||||
key: node-modules-${{ matrix.os }}-${{ hashFiles('yarn.lock') }}
|
||||
|
||||
- name: Check dependencies
|
||||
- name: Install dependencies
|
||||
if: steps.cache-node-modules.outputs.cache-hit != 'true'
|
||||
run: "yarn install --frozen-lockfile --network-timeout 100000"
|
||||
env:
|
||||
npm_config_node_gyp: ${{ github.workspace }}${{ runner.os == 'Windows' && '\node_modules\node-gyp\bin\node-gyp.js' || '/node_modules/node-gyp/bin/node-gyp.js' }}
|
||||
|
||||
12
.github/workflows/studio-publish.yml
vendored
12
.github/workflows/studio-publish.yml
vendored
@@ -220,14 +220,22 @@ jobs:
|
||||
uses: samuelmeuli/action-snapcraft@v3
|
||||
if: matrix.os.type == 'linux'
|
||||
|
||||
- name: Clean cache
|
||||
run: yarn cache clean --all
|
||||
- name: Cache node_modules
|
||||
id: cache-node-modules
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
node_modules
|
||||
apps/studio/node_modules
|
||||
apps/ui-kit/node_modules
|
||||
key: node-modules-${{ matrix.os.name }}-${{ hashFiles('yarn.lock') }}
|
||||
|
||||
# FIXME (matthew) Windows needs retries. It sometimes fails to build
|
||||
# the native oracledb package.
|
||||
# But only sometimes. I cannot figure out why.
|
||||
# Someone should at some point.
|
||||
- name: yarn install (with retry)
|
||||
if: steps.cache-node-modules.outputs.cache-hit != 'true'
|
||||
uses: nick-fields/retry@v2
|
||||
with:
|
||||
timeout_minutes: 20
|
||||
|
||||
Reference in New Issue
Block a user