Files
actual/.github/actions/setup/action.yml
df45b50412 [AI] DX: scope CI Lage cache key per job (#8311)
* [AI] DX: scope CI Lage cache key per job

The Lage cache key was shared across every job in the Build and Test
workflows. The `setup` job (a dependency that finishes first) runs no
Lage task, so it persisted an empty cache under the shared key; every
other job then saw the key already existed and skipped saving its real
cache. The next run restored that empty cache, causing a 100% cache miss.

Key the cache per job so each job restores and persists its own Lage
cache.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GsWzGLUnt9TWkmNVDiYTof

* [AI] DX: remove comment and shorten release note

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GsWzGLUnt9TWkmNVDiYTof

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-06-22 22:09:46 +00:00

79 lines
3.1 KiB
YAML

name: Setup
description: Setup the environment for the project
inputs:
working-directory:
description: 'Working directory to run in, default .'
required: false
default: '.'
download-translations:
description: 'Whether to download translations as part of setup, default true'
required: false
default: 'true'
cache:
description: 'Whether to restore and save dependency and Lage caches, default true'
required: false
default: 'true'
runs:
using: composite
steps:
- name: Install node
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: 22
package-manager-cache: false
- name: Install yarn
run: npm install -g yarn
shell: bash
if: ${{ env.ACT }}
- name: Get Node version
id: get-node
run: echo "version=$(node -v)" >> "$GITHUB_OUTPUT"
shell: bash
- name: Cache
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
if: ${{ inputs.cache == 'true' }}
id: cache
with:
path: ${{ format('{0}/**/node_modules', inputs.working-directory) }}
key: yarn-v1-${{ runner.os }}-${{ steps.get-node.outputs.version }}-${{ hashFiles(format('{0}/**/yarn.lock', inputs.working-directory)) }}
- name: Cache Yarn download cache
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
if: ${{ inputs.cache == 'true' && steps.cache.outputs.cache-hit != 'true' }}
with:
path: ${{ format('{0}/.yarn/cache', inputs.working-directory) }}
key: yarn-dl-${{ runner.os }}-${{ steps.get-node.outputs.version }}-${{ hashFiles(format('{0}/**/yarn.lock', inputs.working-directory)) }}
restore-keys: |
yarn-dl-${{ runner.os }}-${{ steps.get-node.outputs.version }}-
yarn-dl-${{ runner.os }}-
- name: Ensure Lage cache directory exists
run: mkdir -p "$WORKING_DIRECTORY/node_modules/.cache/lage"
shell: bash
env:
WORKING_DIRECTORY: ${{ inputs.working-directory }}
- name: Cache Lage
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
if: ${{ inputs.cache == 'true' }}
with:
path: ${{ format('{0}/node_modules/.cache/lage', inputs.working-directory) }}
key: lage-${{ runner.os }}-${{ github.job }}-${{ github.sha }}
restore-keys: |
lage-${{ runner.os }}-${{ github.job }}-
- name: Install
working-directory: ${{ inputs.working-directory }}
run: yarn --immutable
shell: bash
if: steps.cache.outputs.cache-hit != 'true'
- name: Download translations
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: actualbudget/translations
path: ${{ inputs.working-directory }}/packages/desktop-client/locale
persist-credentials: false
if: ${{ inputs.download-translations == 'true' && !env.ACT }}
- name: Remove untranslated languages
run: packages/desktop-client/bin/remove-untranslated-languages
shell: bash
if: ${{ inputs.download-translations == 'true' && !env.ACT }}