add support for python-version-file

This commit is contained in:
Andrew DiLosa 2022-02-09 19:04:18 -08:00
parent 7f80679172
commit 5d2a3532c1
5 changed files with 89 additions and 2 deletions

View file

@ -20,6 +20,7 @@ This action sets up a Python environment for use in actions by:
- Support for pre-release versions of Python.
- Support for installing any version of PyPy on-flight
- Support for built-in caching of pip and pipenv dependencies
- Support for `.python-version` file
# Usage
@ -36,6 +37,17 @@ steps:
- run: python my_script.py
```
Read Python version from file:
```yaml
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version-file: '.python-version' # Read python version from a file
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- run: python my_script.py
```
Matrix Testing:
```yaml
jobs: