1
0
Fork 0
mirror of https://code.forgejo.org/actions/setup-python synced 2025-06-10 05:12:19 +02:00

Add cache-save: false option

This commit is contained in:
Aarni Koskela 2023-11-10 10:24:46 +02:00
parent 7e8faf07b9
commit 8f0a0b0eda
5 changed files with 85 additions and 9 deletions

View file

@ -381,6 +381,42 @@ steps:
# Or pip install -e '.[test]' to install test dependencies
```
### Skipping cache saving
For some scenarios, it may be useful to only save a given subset of dependencies,
but restore more of them for other workflows. For instance, there may be a heavy
`extras` dependency that you do not need your entire test matrix to download, but
you want to download and test it separately without it being saved in the cache
archive for all runs.
To achieve this, you can use `cache-save: false` on the run that uses the heavy
dependency.
```yaml
test:
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'pip'
cache-dependency-path: pyproject.toml
- run: pip install -e .
test-heavy-extra:
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'pip'
cache-dependency-path: pyproject.toml
cache-save: false
- run: pip install -e '.[heavy-extra]'
```
# Outputs and environment variables
## Outputs