From 3ff7dcbca4389fd58bae3e76f9aafe989f3ad36f Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Fri, 21 Nov 2025 14:32:30 -0300 Subject: [PATCH] chore(ci): improve cache logic for multi arch builds --- .github/actions/meteor-build/action.yml | 14 +++++++------- .github/actions/setup-node/action.yml | 4 ++-- .github/actions/setup-playwright/action.yml | 2 +- .github/workflows/ci.yml | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/actions/meteor-build/action.yml b/.github/actions/meteor-build/action.yml index 934e51bc2ffc4..13fe7da5b302a 100644 --- a/.github/actions/meteor-build/action.yml +++ b/.github/actions/meteor-build/action.yml @@ -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 diff --git a/.github/actions/setup-node/action.yml b/.github/actions/setup-node/action.yml index 6865b342b2dc9..2bee636a47835 100644 --- a/.github/actions/setup-node/action.yml +++ b/.github/actions/setup-node/action.yml @@ -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/" diff --git a/.github/actions/setup-playwright/action.yml b/.github/actions/setup-playwright/action.yml index 4231e139bddb1..1d71e06e2c473 100644 --- a/.github/actions/setup-playwright/action.yml +++ b/.github/actions/setup-playwright/action.yml @@ -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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c3e81ea150324..633220d653cab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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'