From 8505450d2ab7211efe2774d1a2779c528a5f3b23 Mon Sep 17 00:00:00 2001 From: Kosei Kitahara Date: Fri, 1 Nov 2019 00:59:13 +0900 Subject: [PATCH] Add pip (with virtual environments) example for Python project --- examples.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/examples.md b/examples.md index 1fccc23..210b8bc 100644 --- a/examples.md +++ b/examples.md @@ -119,3 +119,20 @@ uses: actions/cache@preview restore-keys: | ${{ runner.os }}-mix- ``` + +### Python - pip + +Use with virtual environments. + +```yaml +- uses: actions/cache@preview + with: + path: .venv + key: ${{ runner.os }}-pip-${{ hashFiles(format('{0}/{1}', github.workspace, 'requirements.txt')) }} + restore-keys: | + ${{ runner.os }}-pip- +- run: | + python -m venv .venv + source .venv/bin/activate + python -m pip install -r requirements.txt +```