chore(ci): improve cache logic for multi arch builds (#37575)

This commit is contained in:
Rodrigo Nascimento 2025-11-24 11:57:34 -03:00 committed by GitHub
parent 1d80ce5741
commit 4102f12cc8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 13 additions and 13 deletions

View File

@ -34,7 +34,7 @@ runs:
id: cache-build
with:
path: /tmp/Rocket.Chat.tar.gz
key: ${{ runner.os }}-${{ runner.arch }}-${{ inputs.type }}-rc-build-${{ inputs.source-hash }}
key: ${{ runner.arch }}-${{ runner.os }}-${{ inputs.type }}-rc-build-${{ inputs.source-hash }}
- name: Set Swap Space
uses: pierotofy/set-swap-space@master
@ -73,27 +73,27 @@ runs:
if: steps.cache-build.outputs.cache-hit != 'true'
with:
path: ./node_modules/.vite
key: vite-local-cache-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('package.json') }}
key: vite-local-cache-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('package.json') }}
restore-keys: |
vite-local-cache-${{ runner.os }}-${{ runner.arch }}-
vite-local-cache-${{ runner.arch }}-${{ runner.os }}-
- name: Cache meteor local
uses: actions/cache@v3
if: steps.cache-build.outputs.cache-hit != 'true'
with:
path: ./apps/meteor/.meteor/local
key: meteor-local-cache-${{ runner.os }}-${{ runner.arch }}-${{ inputs.type }}-${{ hashFiles('apps/meteor/.meteor/versions') }}
key: meteor-local-cache-${{ runner.arch }}-${{ runner.os }}-${{ inputs.type }}-${{ hashFiles('apps/meteor/.meteor/versions') }}
restore-keys: |
meteor-local-cache-${{ runner.os }}-${{ runner.arch }}-${{ inputs.type }}-
meteor-local-cache-${{ runner.arch }}-${{ runner.os }}-${{ inputs.type }}-
- name: Cache meteor
uses: actions/cache@v3
if: steps.cache-build.outputs.cache-hit != 'true'
with:
path: ~/.meteor
key: meteor-cache-${{ runner.os }}-${{ runner.arch }}-${{ inputs.type }}-${{ hashFiles('apps/meteor/.meteor/release') }}
key: meteor-cache-${{ runner.arch }}-${{ runner.os }}-${{ inputs.type }}-${{ hashFiles('apps/meteor/.meteor/release') }}
restore-keys: |
meteor-cache-${{ runner.os }}-${{ runner.arch }}-${{ inputs.type }}-
meteor-cache-${{ runner.arch }}-${{ runner.os }}-${{ inputs.type }}-
- name: Install Meteor
shell: bash

View File

@ -51,8 +51,8 @@ runs:
apps/meteor/ee/server/services/node_modules
packages/apps-engine/node_modules
packages/apps-engine/.deno-cache
key: node-modules-${{ inputs.type }}-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('package.json') }}-${{ hashFiles('yarn.lock') }}-deno-v${{ inputs.deno-version }}-${{ hashFiles('packages/apps-engine/deno-runtime/deno.lock') }}-v3
# key: node-modules-${{ inputs.type }}-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('package.json') }}-${{ hashFiles('yarn.lock') }}-deno-v${{ inputs.deno-version }}-${{ hashFiles('packages/apps-engine/deno-runtime/deno.lock') }}-v${{ github.run_id }}
key: node-modules-${{ inputs.type }}-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('package.json') }}-${{ hashFiles('yarn.lock') }}-deno-v${{ inputs.deno-version }}-${{ hashFiles('packages/apps-engine/deno-runtime/deno.lock') }}-v3
# key: node-modules-${{ inputs.type }}-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('package.json') }}-${{ hashFiles('yarn.lock') }}-deno-v${{ inputs.deno-version }}-${{ hashFiles('packages/apps-engine/deno-runtime/deno.lock') }}-v${{ github.run_id }}
#
# Could use this command to list all paths to save:
# find . -name 'node_modules' -prune | grep -v "/\.meteor/" | grep -v "/meteor/packages/"

View File

@ -11,7 +11,7 @@ runs:
path: |
~/.cache/ms-playwright
# This is the version of Playwright that we are using, if you are willing to upgrade, you should update this.
key: playwright-${{ runner.os }}-${{ runner.arch }}-1.52.0
key: playwright-${{ runner.arch }}-${{ runner.os }}-1.52.0
- name: Install Playwright
shell: bash

View File

@ -172,7 +172,7 @@ jobs:
with:
path: |
/tmp/RocketChat-packages-build.tar.gz
key: ${{ runner.OS }}-packages-build-${{ needs.release-versions.outputs.source-hash }}
key: ${{ runner.arch }}-${{ runner.os }}-packages-build-${{ needs.release-versions.outputs.source-hash }}
- name: Debug cache-hit
run: echo "cache-hit=${{ steps.packages-cache-build.outputs.cache-hit }}"
@ -202,9 +202,9 @@ jobs:
if: steps.packages-cache-build.outputs.cache-hit != 'true'
with:
path: ./node_modules/.vite
key: vite-local-cache-${{ runner.OS }}-${{ hashFiles('package.json') }}
key: vite-local-cache-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('package.json') }}
restore-keys: |
vite-local-cache-${{ runner.os }}-
vite-local-cache-${{ runner.arch }}-${{ runner.os }}-
- uses: rharkor/caching-for-turbo@v1.8
if: steps.packages-cache-build.outputs.cache-hit != 'true'