Skip to content

ci: fix test workflow — deprecated actions/cache@v2 and EquatableMixin - #59

Merged
KamilSztandur merged 3 commits into
mainfrom
fix/ci-deprecated-actions-cache
Aug 14, 2026
Merged

ci: fix test workflow — deprecated actions/cache@v2 and EquatableMixin#59
KamilSztandur merged 3 commits into
mainfrom
fix/ci-deprecated-actions-cache

Conversation

@mateusz-pietras

@mateusz-pietras mateusz-pietras commented Aug 13, 2026

Copy link
Copy Markdown
Member

Makes the test workflow green again. It was failing on two independent problems, one hiding the other.

1. The workflow could not start — deprecated actions/cache@v2

The test workflow has failed on every branch and PR since at least June 23. The job died in ~4 s during action resolution, before a single step ran:

##[error]This request has been automatically failed because it uses a deprecated
version of `actions/cache: v2`. Please update your workflow to use v3/v4 of
actions/cache to avoid interruptions.

GitHub now force-fails any job that resolves actions/cache@v1 or @v2. Our Cache pub dependencies step pinned actions/cache@v2, so the whole job was rejected up front. No analyzer or test output was ever produced — the red check said nothing about the code.

Affected runs include refactor/forms-rework (#52), skill/leancode-forms, and fix/LMG-396-validate-after-field-subscription-fix.

Fix

Rather than bump the pin to actions/cache@v4, the manual cache step is removed entirely. subosito/flutter-action@v2 caches the Flutter SDK and the pub cache itself via cache: true. The publish workflow already uses exactly this and works, so this aligns the two workflows.

The old step was also fragile on its own terms: it cached ${{ env.FLUTTER_HOME }}/.pub-cache, a path that depended on flutter-action@v1 internals, and it keyed only on pubspec.lock while never caching the SDK.

Alongside that:

  • subosito/flutter-action v1v2. v1 is unmaintained and is what tied us to the manual cache step.
  • Dropped the channel: input. The matrix never set matrix.channel, so it always resolved to an empty string.
  • actions/checkout v3v4 in both workflows, so checkout is not the next action to be force-failed.

The check name is unchanged (Flutter 3.29.x), so branch protection rules keep matching.

2. flutter analyze failed — deprecated EquatableMixin

With the workflow running again, the job got as far as the analyzer and failed there:

info • 'EquatableMixin' is deprecated and shouldn't be used. use Equatable as a mixin instead
      • lib/src/field/cubit/field_cubit.dart:283:44 • deprecated_member_use
info • 'EquatableMixin' is deprecated and shouldn't be used. use Equatable as a mixin instead
      • lib/src/form_group_cubit/form_group_cubit.dart:321:27 • deprecated_member_use
2 issues found.

flutter analyze exits non-zero on infos, so these two lines failed the build.

Fix

equatable 2.1.0 turned Equatable into an abstract mixin class and deprecated EquatableMixin. FieldState and FormGroupState now mix in Equatable directly. Both keep their const constructors, because Equatable declares const Equatable().

This requires a constraint bump, equatable: ^2.0.5^2.1.0. In 2.0.8 Equatable is still a plain abstract class and cannot be mixed in, so the old constraint would let a consumer resolve a version where this code does not compile.

Verification

Run locally against Flutter 3.29.0 via fvm, matching the CI version:

  • flutter analyzeNo issues found!
  • flutter test — 69 passed

CI on the first commit of this PR already confirms half of it: the job went from 4 s (rejected at resolution) to 1 m 3 s, reaching the analyzer.

Note for the reviewer

This bumps a dependency constraint on a published package but does not touch version: or CHANGELOG.md. The repo records dependency bumps in the changelog (Bumped blocto^9.0.0.), so an entry is probably wanted — I left the release numbering alone since the ChangeNotifier rewrite in #52 is in flight and will drive the next version.

🤖 Generated with Claude Code

mateusz-pietras and others added 2 commits August 14, 2026 00:07
GitHub force-fails any job that resolves `actions/cache@v2`, so the test
workflow died during action resolution before running a single step. This
affected every branch and PR.

Replace the manual pub cache step with the built-in cache of
subosito/flutter-action@v2, matching the publish workflow. Also bump
actions/checkout to v4 in both workflows.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`flutter analyze` fails on two `deprecated_member_use` infos, which is the
next thing blocking CI once the workflow itself runs again.

equatable 2.1.0 turned `Equatable` into an `abstract mixin class` and
deprecated `EquatableMixin`. Both `FieldState` and `FormGroupState` now mix
in `Equatable` directly. Their const constructors are preserved, since
`Equatable` declares `const Equatable()`.

`Equatable` is only mixable from 2.1.0 onwards — in 2.0.8 it is still a
plain `abstract class` — so the constraint moves from `^2.0.5` to `^2.1.0`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@mateusz-pietras mateusz-pietras changed the title ci: fix test workflow failing on deprecated actions/cache@v2 ci: fix test workflow — deprecated actions/cache@v2 and EquatableMixin Aug 13, 2026
@KamilSztandur
KamilSztandur merged commit 2789325 into main Aug 14, 2026
1 check passed
@KamilSztandur
KamilSztandur deleted the fix/ci-deprecated-actions-cache branch August 14, 2026 07:56
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.

2 participants