From ad6313bc7aeadf1dd0e2e05f4d3544f55b810673 Mon Sep 17 00:00:00 2001 From: Julien Calixte Date: Tue, 17 Feb 2026 01:50:33 +0100 Subject: [PATCH] perf: cache dependencies and build artifacts in GitHub Action Skip bun install and build when bun.lock and source files haven't changed, avoiding re-downloading 428MB of deps on every run. --- action.yml | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/action.yml b/action.yml index ef5e247..601a033 100644 --- a/action.yml +++ b/action.yml @@ -34,13 +34,33 @@ runs: - name: Setup Bun uses: oven-sh/setup-bun@v2 - - name: Build and install Sequoia CLI + - name: Cache dependencies + id: deps-cache + uses: actions/cache@v4 + with: + path: ${{ github.action_path }}/node_modules + key: sequoia-deps-${{ runner.os }}-${{ hashFiles(format('{0}/bun.lock', github.action_path)) }} + + - name: Install dependencies + if: steps.deps-cache.outputs.cache-hit != 'true' shell: bash - run: | - cd ${{ github.action_path }} - bun install - bun run build:cli - bun link --cwd packages/cli + run: cd ${{ github.action_path }} && bun install + + - name: Cache build artifacts + id: build-cache + uses: actions/cache@v4 + with: + path: ${{ github.action_path }}/packages/cli/dist + key: sequoia-build-${{ runner.os }}-${{ hashFiles(format('{0}/bun.lock', github.action_path), format('{0}/packages/cli/src/**', github.action_path)) }} + + - name: Build CLI + if: steps.build-cache.outputs.cache-hit != 'true' + shell: bash + run: cd ${{ github.action_path }} && bun run build:cli + + - name: Link CLI + shell: bash + run: cd ${{ github.action_path }} && bun link --cwd packages/cli - name: Sync state from ATProtocol shell: bash -- 2.51.2