From dc9adda2947a7807fe451a975bf92d593b51925e Mon Sep 17 00:00:00 2001 From: Matt Gaunt-Seo Date: Wed, 11 Jan 2023 11:17:44 -0800 Subject: [PATCH] Switch to cache-dependency-path --- README.md | 3 +++ action.yml | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6261627..abc80b4 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,9 @@ Sets up python and a virtual environment with caching. id: venv with: python-version: 3.10.7 + cache-dependency-path: | + requirements.txt + requirements-frozen.txt - run: pip install -r requirements.txt if: steps.venv.outputs.cache-hit != 'true' ``` diff --git a/action.yml b/action.yml index 71859cb..4e11666 100644 --- a/action.yml +++ b/action.yml @@ -4,7 +4,7 @@ description: 'configures venv, python and caches' inputs: python-version: description: "Version range or exact version of Python or PyPy to use, using SemVer's version range syntax." - requirement-files: + cache-dependency-path: description: "Requirement files to install. Can be a glob pattern." default: '**/requirements*.txt' venv-dir: @@ -23,12 +23,13 @@ runs: with: python-version: ${{ inputs.python-version }} cache: 'pip' + cache-dependency-path: ${{ inputs.cache-dependency-path }} - uses: actions/cache@v3 id: cache-venv with: path: ${{ inputs.venv-dir }} - key: setup-venv-${{ runner.os }}-py-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles(inputs.requirement-files) }} + key: setup-venv-${{ runner.os }}-py-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles(inputs.cache-dependency-path) }} - run: python3 -m venv ${{ inputs.venv-dir }} if: steps.cache-venv.outputs.cache-hit != 'true'