fix(core): fix pnpm install order on ci workflows (#22580)
This commit is contained in:
parent
c49c07d926
commit
705baa7dfd
@ -503,12 +503,13 @@ jobs:
|
||||
echo "##vso[task.setvariable variable=BASE_SHA]$LAST_SHA"
|
||||
fi
|
||||
|
||||
- script: npm install --prefix=$HOME/.local -g pnpm@8
|
||||
displayName: Install PNPM
|
||||
|
||||
# Connect your workspace on my.nx.app and uncomment this to enable task distribution.
|
||||
# The "--stop-agents-after" is optional, but allows idle agents to shut down once the "build" targets have been requested
|
||||
# - script: pnpm exec nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="build"
|
||||
|
||||
- script: npm install --prefix=$HOME/.local -g pnpm@8
|
||||
displayName: Install PNPM
|
||||
- script: pnpm install --frozen-lockfile
|
||||
- script: git branch --track main origin/main
|
||||
condition: eq(variables['Build.Reason'], 'PullRequest')
|
||||
@ -532,12 +533,12 @@ pipelines:
|
||||
script:
|
||||
- export NX_BRANCH=$BITBUCKET_PR_ID
|
||||
|
||||
- npm install --prefix=$HOME/.local -g pnpm@8
|
||||
|
||||
# Connect your workspace on my.nx.app and uncomment this to enable task distribution.
|
||||
# The "--stop-agents-after" is optional, but allows idle agents to shut down once the "build" targets have been requested
|
||||
# - pnpm exec nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="build"
|
||||
|
||||
- npm install --prefix=$HOME/.local -g pnpm@8
|
||||
|
||||
- pnpm install --frozen-lockfile
|
||||
|
||||
- pnpm exec nx-cloud record -- nx format:check
|
||||
@ -575,13 +576,14 @@ jobs:
|
||||
steps:
|
||||
- checkout
|
||||
|
||||
- run:
|
||||
name: Install PNPM
|
||||
command: npm install --prefix=$HOME/.local -g pnpm@8
|
||||
|
||||
# Connect your workspace on my.nx.app and uncomment this to enable task distribution.
|
||||
# The "--stop-agents-after" is optional, but allows idle agents to shut down once the "build" targets have been requested
|
||||
# - run: pnpm exec nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="build"
|
||||
|
||||
- run:
|
||||
name: Install PNPM
|
||||
command: npm install --prefix=$HOME/.local -g pnpm@8
|
||||
- run: pnpm install --frozen-lockfile
|
||||
- nx/set-shas:
|
||||
main-branch-name: 'main'
|
||||
@ -623,13 +625,14 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: 8
|
||||
|
||||
# Connect your workspace on my.nx.app and uncomment this to enable task distribution.
|
||||
# The "--stop-agents-after" is optional, but allows idle agents to shut down once the "build" targets have been requested
|
||||
# - run: pnpm exec nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="build"
|
||||
|
||||
- uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: 8
|
||||
# Cache node_modules
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
@ -667,13 +670,14 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: 8
|
||||
|
||||
# Connect your workspace on my.nx.app and uncomment this to enable task distribution.
|
||||
# The "--stop-agents-after" is optional, but allows idle agents to shut down once the "build" targets have been requested
|
||||
# - run: pnpm exec nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="build"
|
||||
|
||||
- uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: 8
|
||||
# Cache node_modules
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
@ -702,12 +706,12 @@ CI:
|
||||
- main
|
||||
- merge_requests
|
||||
script:
|
||||
- npm install --prefix=$HOME/.local -g pnpm@8
|
||||
|
||||
# Connect your workspace on my.nx.app and uncomment this to enable task distribution.
|
||||
# The "--stop-agents-after" is optional, but allows idle agents to shut down once the "build" targets have been requested
|
||||
# - pnpm exec nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="build"
|
||||
|
||||
- npm install --prefix=$HOME/.local -g pnpm@8
|
||||
|
||||
- pnpm install --frozen-lockfile
|
||||
- NX_HEAD=$CI_COMMIT_SHA
|
||||
- NX_BASE=\${CI_MERGE_REQUEST_DIFF_BASE_SHA:-$CI_COMMIT_BEFORE_SHA}
|
||||
|
||||
@ -41,14 +41,16 @@ jobs:
|
||||
echo "##vso[task.setvariable variable=BASE_SHA]$LAST_SHA"
|
||||
fi
|
||||
|
||||
<% if(packageManager == 'pnpm'){ %>
|
||||
- script: npm install --prefix=$HOME/.local -g pnpm@8
|
||||
displayName: Install PNPM
|
||||
|
||||
<% } %>
|
||||
# Connect your workspace on <%= nxCloudHost %> and uncomment this to enable task distribution.
|
||||
# The "--stop-agents-after" is optional, but allows idle agents to shut down once the "<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>" targets have been requested
|
||||
# - script: <%= packageManagerPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
|
||||
|
||||
<% if(packageManager == 'pnpm'){ %>
|
||||
- script: npm install --prefix=$HOME/.local -g pnpm@8
|
||||
displayName: Install PNPM
|
||||
<% } %>- script: <%= packageManagerInstall %>
|
||||
- script: <%= packageManagerInstall %>
|
||||
- script: git branch --track main origin/main
|
||||
condition: eq(variables['Build.Reason'], 'PullRequest')
|
||||
|
||||
|
||||
@ -11,13 +11,14 @@ pipelines:
|
||||
script:
|
||||
- export NX_BRANCH=$BITBUCKET_PR_ID
|
||||
|
||||
<% if(packageManager == 'pnpm'){ %>
|
||||
- npm install --prefix=$HOME/.local -g pnpm@8
|
||||
|
||||
<% } %>
|
||||
# Connect your workspace on <%= nxCloudHost %> and uncomment this to enable task distribution.
|
||||
# The "--stop-agents-after" is optional, but allows idle agents to shut down once the "<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>" targets have been requested
|
||||
# - <%= packageManagerPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
|
||||
|
||||
<% if(packageManager == 'pnpm'){ %>
|
||||
- npm install --prefix=$HOME/.local -g pnpm@8
|
||||
<% } %>
|
||||
- <%= packageManagerInstall %>
|
||||
|
||||
- <%= packageManagerPrefix %> nx-cloud record -- nx format:check
|
||||
|
||||
@ -9,16 +9,17 @@ jobs:
|
||||
- image: cimg/node:lts-browsers
|
||||
steps:
|
||||
- checkout
|
||||
<% if(packageManager == 'pnpm'){ %>
|
||||
- run:
|
||||
name: Install PNPM
|
||||
command: npm install --prefix=$HOME/.local -g pnpm@8
|
||||
<% } %>
|
||||
|
||||
# Connect your workspace on <%= nxCloudHost %> and uncomment this to enable task distribution.
|
||||
# The "--stop-agents-after" is optional, but allows idle agents to shut down once the "<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>" targets have been requested
|
||||
# - run: <%= packageManagerPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
|
||||
|
||||
<% if(packageManager == 'pnpm'){ %>
|
||||
- run:
|
||||
name: Install PNPM
|
||||
command: npm install --prefix=$HOME/.local -g pnpm@8
|
||||
<% } %>- run: <%= packageManagerInstall %>
|
||||
- run: <%= packageManagerInstall %>
|
||||
- nx/set-shas:
|
||||
main-branch-name: '<%= mainBranch %>'
|
||||
|
||||
|
||||
@ -17,16 +17,17 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
<% if(packageManager == 'pnpm'){ %>
|
||||
- uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: 8
|
||||
<% } %>
|
||||
|
||||
# Connect your workspace on <%= nxCloudHost %> and uncomment this to enable task distribution.
|
||||
# The "--stop-agents-after" is optional, but allows idle agents to shut down once the "<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>" targets have been requested
|
||||
# - run: <%= packageManagerPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
|
||||
|
||||
<% if(packageManager == 'pnpm'){ %>
|
||||
- uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: 8
|
||||
<% } %># Cache node_modules
|
||||
# Cache node_modules
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 20
|
||||
|
||||
@ -9,13 +9,13 @@ variables:
|
||||
- main
|
||||
- merge_requests
|
||||
script:
|
||||
<% if(packageManager == 'pnpm'){ %>
|
||||
- npm install --prefix=$HOME/.local -g pnpm@8
|
||||
<% } %>
|
||||
# Connect your workspace on <%= nxCloudHost %> and uncomment this to enable task distribution.
|
||||
# The "--stop-agents-after" is optional, but allows idle agents to shut down once the "<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>" targets have been requested
|
||||
# - <%= packageManagerPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
|
||||
|
||||
<% if(packageManager == 'pnpm'){ %>
|
||||
- npm install --prefix=$HOME/.local -g pnpm@8
|
||||
<% } %>
|
||||
- <%= packageManagerInstall %>
|
||||
- NX_HEAD=$CI_COMMIT_SHA
|
||||
- NX_BASE=${CI_MERGE_REQUEST_DIFF_BASE_SHA:-$CI_COMMIT_BEFORE_SHA}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user