fix: move lock files to test-fixtures, pnpm global-bin-dir, node-based version detection - #12
Merged
Merged
Conversation
…d version detection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes all remaining test failures. Three root causes:
1. pnpm-lock.yaml in repo root broke npm/yarn/node-matrix jobs
Angular CLI 19 auto-detects lock files to choose the package manager. Having
pnpm-lock.yamlin root caused every npm/yarn test job to fail with:The project is configured to use 'pnpm', but it is not installed or cannot be found.Fix: moved
pnpm-lock.yamlandyarn.lockto.github/test-fixtures/(Angular CLI only detects root-level lock files). Test workflow now passescache-dependency-path: .github/test-fixtures/pnpm-lock.yamlfor pnpm jobs.2. pnpm global bin not on PATH
pnpm v9+ puts global bins in
{PNPM_HOME}/bin/, butpnpm/action-setuponly addsPNPM_HOMEitself to PATH. Error:The configured global bin directory is not in PATH.Fix:
pnpm config set global-bin-dir "$PNPM_HOME"before the global install — bins go directly intoPNPM_HOMEwhich is already on PATH.3. Version detection via
ng versionwas unreliableng versioninside the composite action had PATH timing issues (GITHUB_PATH updates don't take effect within the same composite action) and pipefail edge cases.Fix: replaced with
node -e "require(...package.json).version"— reads the installed@angular/cli/package.jsondirectly vianpm root -g/pnpm root -g/yarn global dir. No PATH dependency, works cross-platform.