Skip to content

ci: fix yarn cache and replace deprecated actions - #1234

Merged
Naturalclar merged 1 commit into
masterfrom
ci/fix-yarn-cache-and-deprecated-actions
Nov 15, 2026
Merged

Naturalclar merged 1 commit into
masterfrom
ci/fix-yarn-cache-and-deprecated-actions

Conversation

@Naturalclar

Copy link
Copy Markdown
Member

Context

This started as an investigation into the failing Build run on master (31983633654, 2026-08-17, android job). That failure does not reproduce. Its logs have expired (HTTP 410), PR runs on the same code passed on both Aug 16 and Aug 19, a fresh workflow_dispatch on master today is fully green (43666919034), and a clean local ./gradlew clean assembleDebug succeeds. It looks transient and there is no evidence left to diagnose it.

What the investigation did turn up is a real defect: the yarn cache has never worked.

Problem

The Get yarn cache step runs yarn cache dir, a Yarn 1 command. This repo is on Yarn 4 (packageManager: yarn@4.1.1, yarnPath in .yarnrc.yml), so the command exits with a usage error and its stderr becomes the cache path. From today's green run:

Run echo "::set-output name=dir::$(yarn cache dir)"
actions/cache@v4   path: Unknown Syntax Error: Command not found; did you mean one of:
                   Cache not found for input keys: Linux-yarn-10871914d416...
Install Dependencies   ➤ YN0000: · Yarn 4.1.1
Post Run actions/cache@v4
  [warning]Path Validation Error: Path(s) specified in the action for caching
           do(es) not exist, hence no cache is being saved.

So the cache never restores and never saves, in all four jobs that declare it. Every run re-downloads the full dependency tree. It fails silently as a warning, which is why it went unnoticed while CI stayed green.

Changes

  • yarn cache dir → yarn config get cacheFolder — the Yarn 4 equivalent. Verified it resolves correctly under Yarn 4.1.1.
  • ::set-output:: → $GITHUB_OUTPUT — same line; GitHub has deprecated set-output and plans to disable it.
  • Bump actions GitHub is force-running on Node 24: checkout@v2 → v5, setup-node@v1 → v5, setup-java@v1 → v5. setup-java v2+ requires an explicit distribution; temurin matches the adoptopenjdk-17.0.10+7 pinned in .tool-versions.
  • Rename the lint step "ESLint Checks" → "Biome Checks". It runs yarn lint, which is Biome — there is no ESLint config in the repo. The job name is unchanged, so the lint (22) status check keeps its name and branch protection is unaffected.

Verification

  • All five jobs green on master immediately before this change, so this PR's run is a clean A/B on the same code.
  • Workflow YAML parsed and asserted free of set-output / yarn cache dir.
  • Clean local Android build (BUILD SUCCESSFUL, Java 17 + AGP via react-native-test-app).
  • The real confirmation is this PR's own CI run — specifically that Get yarn cache now prints a real path and Post Run actions/cache@v4 saves instead of warning. Worth a look at the log before merging.

Not addressed

  • The August android flake. No logs survive; nothing to fix without a reproduction. If it returns, the next run's logs will be readable.
  • ubuntu-latest → Ubuntu 26. GitHub began that migration on 2026-10-19 and it is a plausible mechanism for an Android job that intermittently breaks. Pinning ubuntu-24.04 would insulate CI from it, but that changes the build environment and belongs in its own PR rather than riding along here.
  • PR fix(android): skip explicit Kotlin plugin when AGP registers the kotlin extension #1226 (AGP 9 built-in Kotlin). Related by subject but a different failure — it fixes Cannot add extension with name 'kotlin', which is not what happened here. Still worth merging on its own merits.

🤖 Generated with Claude Code

The `Get yarn cache` step ran `yarn cache dir`, a Yarn 1 command. This
repo is on Yarn 4 (`packageManager: yarn@4.1.1`, `yarnPath` in
`.yarnrc.yml`), so the command exits with a usage error and its stderr
becomes the cache path:

    actions/cache@v4   path: Unknown Syntax Error: Command not found
                       Cache not found for input keys: Linux-yarn-1087...
    Post Run actions/cache@v4
      Path Validation Error: Path(s) specified in the action for caching
      do(es) not exist, hence no cache is being saved.

The cache therefore never restored and never saved in any of the four
jobs that declare it. Use `yarn config get cacheFolder` instead, which
is the Yarn 4 equivalent.

The same line used `::set-output::`, which GitHub has deprecated and
plans to disable, so it moves to `$GITHUB_OUTPUT`.

Also bump the actions that GitHub is force-running on Node 24:
checkout@v2 -> v5, setup-node@v1 -> v5, setup-java@v1 -> v5. setup-java
v2+ requires an explicit `distribution`; `temurin` matches the
`adoptopenjdk-17.0.10+7` in `.tool-versions`.

Finally, rename the lint step from "ESLint Checks" to "Biome Checks" --
it runs `yarn lint`, which is Biome. The job name is unchanged, so the
`lint (22)` status check keeps its name.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@Naturalclar
Naturalclar merged commit 86019c1 into master Nov 15, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant