From 161a2cfb3e8b762daac98ed8c121d4ef3165c796 Mon Sep 17 00:00:00 2001 From: Eric Nguyen Date: Mon, 8 Aug 2022 16:12:49 +0000 Subject: [PATCH] Merged PR 15: Azure-Pipelines: Use pnpm to accelerate npm install command --- azure-pipelines.yml | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 28f4504..7b6f59f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -11,7 +11,21 @@ trigger: pool: vmImage: ubuntu-latest +variables: + pnpm_config_cache: $(Pipeline.Workspace)/.pnpm-store + steps: +- task: Cache@2 + inputs: + key: 'pnpm | "$(Agent.OS)" | pnpm-lock.yaml' + path: $(pnpm_config_cache) + displayName: Cache pnpm + +- script: | + curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm@7 + pnpm config set store-dir $(pnpm_config_cache) + displayName: "Setup pnpm" + - task: NodeTool@0 inputs: versionSpec: '16.x' @@ -21,8 +35,8 @@ steps: node --version node ./test-server/node-http.js & jobs - npm ci - npm run test:nowatch + pnpm i + pnpm run test:nowatch kill -2 %1 2>/dev/null displayName: 'Test on Node.js 16.x LTS' @@ -35,7 +49,7 @@ steps: node --version node ./test-server/node-http.js & jobs - npm ci - npm run test:nowatch + pnpm i + pnpm run test:nowatch kill -2 %1 2>/dev/null displayName: 'Test on Node.js 18.x Latest' \ No newline at end of file