From 5682a69017d19efbcc58e3b01575275daab693be Mon Sep 17 00:00:00 2001 From: Ammar Date: Sat, 25 Oct 2025 19:38:01 -0500 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=A4=96=20Optimize=20setup-cmux=20acti?= =?UTF-8?q?on=20with=20node=5Fmodules=20caching?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit _Generated with `cmux`_ Add node_modules directory caching to drastically reduce install times when the lockfile hasn't changed. This caches the entire node_modules folder in addition to bun's install cache, eliminating the need to reinstall packages on every CI run. Expected impact: Reduce bun install time from 5-7s to <1s when cache hits. --- .github/actions/setup-cmux/action.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/actions/setup-cmux/action.yml b/.github/actions/setup-cmux/action.yml index ee3edb5147..f4b17b665c 100644 --- a/.github/actions/setup-cmux/action.yml +++ b/.github/actions/setup-cmux/action.yml @@ -8,13 +8,21 @@ runs: with: bun-version: latest - - name: Cache bun dependencies + - name: Cache node_modules + uses: actions/cache@v4 + with: + path: node_modules + key: ${{ runner.os }}-node-modules-${{ hashFiles('**/bun.lock') }} + restore-keys: | + ${{ runner.os }}-node-modules- + + - name: Cache bun install cache uses: actions/cache@v4 with: path: ~/.bun/install/cache - key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }} + key: ${{ runner.os }}-bun-cache-${{ hashFiles('**/bun.lock') }} restore-keys: | - ${{ runner.os }}-bun- + ${{ runner.os }}-bun-cache- - name: Cache Homebrew (macOS) if: runner.os == 'macOS' From 67700df2fcc1ab3025b66218238ce613b2309863 Mon Sep 17 00:00:00 2001 From: Ammar Date: Sat, 25 Oct 2025 19:40:42 -0500 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A4=96=20Invalidate=20node=5Fmodules?= =?UTF-8?q?=20cache=20on=20Bun=20version/arch=20changes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Include Bun version and runner architecture in cache key to ensure node_modules cache is invalidated when the Bun runtime changes. This prevents native module ABI mismatches that could cause subtle failures. --- .github/actions/setup-cmux/action.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup-cmux/action.yml b/.github/actions/setup-cmux/action.yml index f4b17b665c..0b6d314fae 100644 --- a/.github/actions/setup-cmux/action.yml +++ b/.github/actions/setup-cmux/action.yml @@ -8,13 +8,18 @@ runs: with: bun-version: latest + - name: Get Bun version + id: bun-version + shell: bash + run: echo "version=$(bun --version)" >> $GITHUB_OUTPUT + - name: Cache node_modules uses: actions/cache@v4 with: path: node_modules - key: ${{ runner.os }}-node-modules-${{ hashFiles('**/bun.lock') }} + key: ${{ runner.os }}-${{ runner.arch }}-bun-${{ steps.bun-version.outputs.version }}-node-modules-${{ hashFiles('**/bun.lock') }} restore-keys: | - ${{ runner.os }}-node-modules- + ${{ runner.os }}-${{ runner.arch }}-bun-${{ steps.bun-version.outputs.version }}-node-modules- - name: Cache bun install cache uses: actions/cache@v4