Skip to content

Support yarn 4 projects#5

Open
xurxodev wants to merge 6 commits intomasterfrom
feature/support_yarn_4_projects
Open

Support yarn 4 projects#5
xurxodev wants to merge 6 commits intomasterfrom
feature/support_yarn_4_projects

Conversation

@xurxodev
Copy link

📌 References

📝 Implementation

Problem: In repos with "packageManager": "yarn@4.12.0" (e.g. dhis2-app-skeleton), the test job fails because the first use of yarn (e.g. in "Get yarn cache directory path") happens before Corepack is enabled, so the runner falls back to Yarn 1.x.

Changes in .github/workflows/app-test.yml:
Removed cache: "yarn" from the "Setup Node.js version from .nvmrc" step so yarn is not run before enabling Corepack.
Added an "Enable Corepack" step (corepack enable) right after setting up Node and before any yarn command.

Result: With Corepack enabled, repos without packageManager keep using Yarn 1.x; repos with packageManager use the specified version (e.g. Yarn 4). Dependency caching is unchanged and still done in "Get yarn cache directory path" and "Cache yarn dependencies".

📹 Screenshots/Screen capture

🔥 Testing

Run the workflow on a Yarn 1 repo (no packageManager): it should still pass.
Run the workflow on a Yarn 4 repo with packageManager (e.g. dhis2-app-skeleton): the "Unit tests" job should pass; previously it failed at "Setup Node.js version from .nvmrc" / "Get yarn cache directory path" with the Corepack error.

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