nrwl / ci

47 stars 51 forks source link

packageManager in package.json is not respected for pnpm setup action #76

Closed yannickmonney closed 1 year ago

yannickmonney commented 1 year ago

The setup action of PNPM should always take into account the version set in the package manager. This is already the case by default for the action.

The issue here is that the pnpm-setup action by default takes the version in package.json (packageManager) into account if no version is specified. nrwl/ci on the other hand takes the latest version if none is specified.

AdditionAddict commented 1 year ago

It does. Perhaps you need to repeat the pnpm-version in with for agents job

See 2 x <-------------------

name: CI

on:
  push:
    branches:
      - main
  pull_request:

jobs:
  main-workflow:
    name: Nx Cloud - Main Job
    uses: nrwl/ci/.github/workflows/nx-cloud-main.yml@v0.11.3
    with:
      pnpm-version: 7.5.2 <-----------------
      number-of-agents: 3
      init-commands: |
        pnpm exec nx-cloud start-ci-run --stop-agents-after="build" --agent-count=3
      parallel-commands: |
        pnpm exec nx workspace-lint
        pnpm exec prettier --write .
        pnpm exec prettier --check .
      parallel-commands-on-agents: |
        pnpm exec nx affected --target=lint --parallel=3
        pnpm exec nx affected --target=test --parallel=3 --ci --code-coverage
        pnpm exec nx affected --target=build --parallel=3

  agents:
    name: Nx Cloud - Agents
    uses: nrwl/ci/.github/workflows/nx-cloud-agents.yml@v0.11.2
    with:
      number-of-agents: 3
      pnpm-version: 7.5.2 <-----------------
yannickmonney commented 1 year ago

@AdditionAddict No, sorry if there's a misunderstanding. The issue here is that the pnpm-setup action by default takes the version in package.json (packageManager) into account if no version is specified. nrwl/ci on the other hand takes the latest version if none is specified.

Ticket has been updated.