diff --git a/.github/workflows/studio-build-non-production.yml b/.github/workflows/studio-build-non-production.yml index ee3040708..8291ac2b1 100644 --- a/.github/workflows/studio-build-non-production.yml +++ b/.github/workflows/studio-build-non-production.yml @@ -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' }} diff --git a/.github/workflows/studio-publish.yml b/.github/workflows/studio-publish.yml index b98dccc80..384481777 100644 --- a/.github/workflows/studio-publish.yml +++ b/.github/workflows/studio-publish.yml @@ -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