From 0ae03de2b799ae88b378c51b87476d242b3d8ef0 Mon Sep 17 00:00:00 2001 From: Jacob Gillespie Date: Thu, 15 Jul 2021 20:14:30 +0100 Subject: [PATCH] Reorder to npm, yarn, pnpm --- README.md | 30 +++++++++++++++--------------- action.yml | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 58997afc..1b66c7b1 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ This action provides the following functionality for GitHub Actions users: - Optionally downloading and caching distribution of the requested Node.js version, and adding it to the PATH -- Optionally caching npm/pnpm/yarn dependencies +- Optionally caching npm/yarn/pnpm dependencies - Registering problem matchers for error output - Configuring authentication for GPR or npm @@ -41,7 +41,7 @@ nvm lts syntax: `lts/erbium`, `lts/fermium`, `lts/*` ### Caching packages dependencies -The action has a built-in functionality for caching and restoring npm/yarn dependencies. Supported package managers are `npm`, `pnpm`, `yarn`. The `cache` input is optional, and caching is turned off by default. +The action has a built-in functionality for caching and restoring npm/yarn dependencies. Supported package managers are `npm`, `yarn`, `pnpm`. The `cache` input is optional, and caching is turned off by default. **Caching npm dependencies:** ```yaml @@ -55,6 +55,19 @@ steps: - run: npm test ``` +**Caching yarn dependencies:** +```yaml +steps: +- uses: actions/checkout@v2 +- uses: actions/setup-node@v2 + with: + node-version: '14' + cache: 'yarn' +- run: yarn install +- run: yarn test +``` +Yarn caching handles both yarn versions: 1 or 2. + **Caching pnpm (v6.10+) dependencies:** ```yaml # This workflow uses actions that are not certified by GitHub. @@ -77,19 +90,6 @@ steps: - run: pnpm test ``` -**Caching yarn dependencies:** -```yaml -steps: -- uses: actions/checkout@v2 -- uses: actions/setup-node@v2 - with: - node-version: '14' - cache: 'yarn' -- run: yarn install -- run: yarn test -``` -Yarn caching handles both yarn versions: 1 or 2. - > At the moment, only `lock` files in the project root are supported. ### Matrix Testing: diff --git a/action.yml b/action.yml index 2552b8d5..943d5310 100644 --- a/action.yml +++ b/action.yml @@ -20,7 +20,7 @@ inputs: description: Used to pull node distributions from node-versions. Since there's a default, this is typically not supplied by the user. default: ${{ github.token }} cache: - description: 'Used to specify a package manager for caching in the default directory. Supported values: npm, pnpm, yarn' + description: 'Used to specify a package manager for caching in the default directory. Supported values: npm, yarn, pnpm' # TODO: add input to control forcing to pull from cloud or dist. # escape valve for someone having issues or needing the absolute latest which isn't cached yet # Deprecated option, do not use. Will not be supported after October 1, 2019