From dd3eb629473d828982e55f1ab271f09b6095502e Mon Sep 17 00:00:00 2001 From: Jacob Gillespie Date: Tue, 20 Jul 2021 16:13:27 +0100 Subject: [PATCH 1/3] Add documentation for actions/setup-node pnpm cache --- .../guides/building-and-testing-nodejs.md | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/content/actions/guides/building-and-testing-nodejs.md b/content/actions/guides/building-and-testing-nodejs.md index b9468163cb983..878e4c39260a7 100644 --- a/content/actions/guides/building-and-testing-nodejs.md +++ b/content/actions/guides/building-and-testing-nodejs.md @@ -265,7 +265,30 @@ steps: - run: yarn test ``` -To cache dependencies, you must have a `package-lock.json` or `yarn.lock` file in the root of the repository. If you need more flexible customization, you can use the [`cache` action](https://github.com/marketplace/actions/cache). For more information, see "Caching dependencies to speed up workflows". +The following example caches dependencies for pnpm (v6.10+). + +```yaml{:copy} +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +# NOTE: pnpm caching support requires pnpm version >= 6.10.0 + +steps: +- uses: actions/checkout@v2 +- uses: pnpm/action-setup@646cdf48217256a3d0b80361c5a50727664284f2 + with: + version: 6.10.0 +- uses: actions/setup-node@v2 + with: + node-version: '14' + cache: 'pnpm' +- run: pnpm install +- run: pnpm test +``` + +To cache dependencies, you must have a `package-lock.json`, `yarn.lock`, or `pnpm-lock.yaml` file in the root of the repository. If you need more flexible customization, you can use the [`cache` action](https://github.com/marketplace/actions/cache). For more information, see "Caching dependencies to speed up workflows". ## Building and testing your code From 6d99f0fef2dfde1f01dcf5df9a1aff3d078fc904 Mon Sep 17 00:00:00 2001 From: Jacob Gillespie Date: Tue, 20 Jul 2021 18:06:18 +0100 Subject: [PATCH 2/3] Add pnpm to actions/setup-node note --- .../guides/caching-dependencies-to-speed-up-workflows.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/actions/guides/caching-dependencies-to-speed-up-workflows.md b/content/actions/guides/caching-dependencies-to-speed-up-workflows.md index 9000798ce5946..0f5bf68acee16 100644 --- a/content/actions/guides/caching-dependencies-to-speed-up-workflows.md +++ b/content/actions/guides/caching-dependencies-to-speed-up-workflows.md @@ -26,7 +26,7 @@ To cache dependencies for a job, you'll need to use {% data variables.product.pr If you are caching Ruby gems, instead consider using the Ruby maintained action, which can cache bundle installs on initiation. For more information, see [`ruby/setup-ruby`](https://github.com/ruby/setup-ruby#caching-bundle-install-automatically). -To cache and restore dependencies for npm or Yarn, you can use the [`actions/setup-node` action](https://github.com/actions/setup-node). +To cache and restore dependencies for npm, Yarn, or pnpm, you can use the [`actions/setup-node` action](https://github.com/actions/setup-node). {% warning %} From 0c4e5b69c66a1590e853bc7f259a954ca06ad761 Mon Sep 17 00:00:00 2001 From: Sarah Edwards Date: Wed, 28 Jul 2021 12:51:47 -0700 Subject: [PATCH 3/3] use reusable --- content/actions/guides/building-and-testing-nodejs.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/content/actions/guides/building-and-testing-nodejs.md b/content/actions/guides/building-and-testing-nodejs.md index 878e4c39260a7..f5a8b714e2fa3 100644 --- a/content/actions/guides/building-and-testing-nodejs.md +++ b/content/actions/guides/building-and-testing-nodejs.md @@ -268,10 +268,7 @@ steps: The following example caches dependencies for pnpm (v6.10+). ```yaml{:copy} -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. +{% data reusables.actions.actions-not-certified-by-github-comment %} # NOTE: pnpm caching support requires pnpm version >= 6.10.0