From 62a4d754427893bc6d043c6d4f5486490cab29b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eric=20Meadows-J=C3=B6nsson?= Date: Tue, 24 Nov 2020 15:52:21 +0100 Subject: [PATCH 1/2] Also cache _build for Elixir --- examples.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples.md b/examples.md index c66eca6..53b04c7 100644 --- a/examples.md +++ b/examples.md @@ -99,7 +99,9 @@ steps: ```yaml - uses: actions/cache@v2 with: - path: deps + path: | + deps + _build key: ${{ runner.os }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} restore-keys: | ${{ runner.os }}-mix- From 4498c5b4d8b0673dbc7d9731bc11d9cc5a2c6087 Mon Sep 17 00:00:00 2001 From: Pradyun Gedam <3275593+pradyunsg@users.noreply.github.com> Date: Mon, 29 Mar 2021 22:34:02 +0100 Subject: [PATCH 2/2] Drop the example based on using pip's internals (#519) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit pip's documentation explicitly states to not use `import pip`: > While it is implemented in Python, and so is available from your Python code via > `import pip`, you must not use pip’s internal APIs in this way. This example is in direct contradiction with the documentation's guidance and, thus, has been removed. --- examples.md | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/examples.md b/examples.md index ac4630d..759a277 100644 --- a/examples.md +++ b/examples.md @@ -389,23 +389,6 @@ jobs: ${{ runner.os }}-pip- ``` -### Using a script to get cache location - -> Note: This uses an internal pip API and may not always work -```yaml -- name: Get pip cache dir - id: pip-cache - run: | - python -c "from pip._internal.locations import USER_CACHE_DIR; print('::set-output name=dir::' + USER_CACHE_DIR)" - -- uses: actions/cache@v2 - with: - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pip- -``` - ## Python - pipenv ```yaml