Add poetry example

This commit is contained in:
Rowan Molony 2023-02-17 15:12:54 +00:00
parent 81b7281936
commit bbe739ea39
2 changed files with 58 additions and 39 deletions

View File

@ -168,6 +168,7 @@ See [Examples](examples.md) for a list of `actions/cache` implementations for us
* [PHP - Composer](./examples.md#php---composer) * [PHP - Composer](./examples.md#php---composer)
* [Python - pip](./examples.md#python---pip) * [Python - pip](./examples.md#python---pip)
* [Python - pipenv](./examples.md#python---pipenv) * [Python - pipenv](./examples.md#python---pipenv)
* [Python - poetry](./examples.md#python---poetry)
* [R - renv](./examples.md#r---renv) * [R - renv](./examples.md#r---renv)
* [Ruby - Bundler](./examples.md#ruby---bundler) * [Ruby - Bundler](./examples.md#ruby---bundler)
* [Rust - Cargo](./examples.md#rust---cargo) * [Rust - Cargo](./examples.md#rust---cargo)

View File

@ -1,44 +1,51 @@
# Examples # Examples
- [C# - NuGet](#c---nuget) - [Examples](#examples)
- [Clojure - Lein Deps](#clojure---lein-deps) - [C# - NuGet](#c---nuget)
- [D - DUB](#d---dub) - [Clojure - Lein Deps](#clojure---lein-deps)
- [POSIX](#posix) - [D - DUB](#d---dub)
- [Windows](#windows) - [POSIX](#posix)
- [Deno](#deno) - [Windows](#windows)
- [Linux](#linux) - [Deno](#deno)
- [macOS](#macos) - [Linux](#linux)
- [Windows](#windows-1) - [macOS](#macos)
- [Elixir - Mix](#elixir---mix) - [Windows](#windows-1)
- [Erlang - Rebar3](#erlang--rebar3) - [Elixir - Mix](#elixir---mix)
- [Go - Modules](#go---modules) - [Erlang - Rebar3](#erlang---rebar3)
- [Linux](#linux-1) - [Go - Modules](#go---modules)
- [macOS](#macos-1) - [Linux](#linux-1)
- [Windows](#windows-2) - [macOS](#macos-1)
- [Haskell - Cabal](#haskell---cabal) - [Windows](#windows-2)
- [Haskell - Stack](#haskell---stack) - [Haskell - Cabal](#haskell---cabal)
- [Java - Gradle](#java---gradle) - [Haskell - Stack](#haskell---stack)
- [Java - Maven](#java---maven) - [Linux or macOS](#linux-or-macos)
- [Node - npm](#node---npm) - [Windows](#windows-3)
- [Node - Lerna](#node---lerna) - [Java - Gradle](#java---gradle)
- [Node - Yarn](#node---yarn) - [Java - Maven](#java---maven)
- [Node - Yarn 2](#node---yarn-2) - [Node - npm](#node---npm)
- [OCaml/Reason - esy](#ocamlreason---esy) - [**Get npm cache directory using same shell**](#get-npm-cache-directory-using-same-shell)
- [PHP - Composer](#php---composer) - [Bash shell](#bash-shell)
- [Python - pip](#python---pip) - [PWSH shell](#pwsh-shell)
- [Simple example](#simple-example) - [Node - Lerna](#node---lerna)
- [Multiple OS's in a workflow](#multiple-oss-in-a-workflow) - [Node - Yarn](#node---yarn)
- [Multiple OS's in a workflow with a matrix](#multiple-oss-in-a-workflow-with-a-matrix) - [Node - Yarn 2](#node---yarn-2)
- [Using pip to get cache location](#using-pip-to-get-cache-location) - [OCaml/Reason - esy](#ocamlreason---esy)
- [Python - pipenv](#python---pipenv) - [PHP - Composer](#php---composer)
- [R - renv](#r---renv) - [Python - pip](#python---pip)
- [Ruby - Bundler](#ruby---bundler) - [Simple example](#simple-example)
- [Rust - Cargo](#rust---cargo) - [Multiple OS's in a workflow](#multiple-oss-in-a-workflow)
- [Scala - SBT](#scala---sbt) - [Multiple OS's in a workflow with a matrix](#multiple-oss-in-a-workflow-with-a-matrix)
- [Swift, Objective-C - Carthage](#swift-objective-c---carthage) - [Using pip to get cache location](#using-pip-to-get-cache-location)
- [Swift, Objective-C - CocoaPods](#swift-objective-c---cocoapods) - [Python - pipenv](#python---pipenv)
- [Swift - Swift Package Manager](#swift---swift-package-manager) - [Python - poetry](#python---poetry)
- [Swift - Mint](#swift---mint) - [R - renv](#r---renv)
- [Ruby - Bundler](#ruby---bundler)
- [Rust - Cargo](#rust---cargo)
- [Scala - SBT](#scala---sbt)
- [Swift, Objective-C - Carthage](#swift-objective-c---carthage)
- [Swift, Objective-C - CocoaPods](#swift-objective-c---cocoapods)
- [Swift - Swift Package Manager](#swift---swift-package-manager)
- [Swift - Mint](#swift---mint)
## C# - NuGet ## C# - NuGet
@ -540,6 +547,17 @@ jobs:
key: ${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-pipenv-${{ hashFiles('Pipfile.lock') }} key: ${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-pipenv-${{ hashFiles('Pipfile.lock') }}
``` ```
## Python - poetry
```yaml
- uses: actions/cache@v3
with:
path: ~/.cache/pypoetry
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
```
## R - renv ## R - renv
For renv, the cache directory will vary by OS. The `RENV_PATHS_ROOT` environment variable is used to set the cache location. Have a look at https://rstudio.github.io/renv/reference/paths.html#details for more details. For renv, the cache directory will vary by OS. The `RENV_PATHS_ROOT` environment variable is used to set the cache location. Have a look at https://rstudio.github.io/renv/reference/paths.html#details for more details.