-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathaction.yaml
More file actions
37 lines (32 loc) · 1.28 KB
/
action.yaml
File metadata and controls
37 lines (32 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Setup/Cache Env
description: 'Sets up and caches a python env. Will only install dependencies if no cache was hit.'
inputs:
pyproject-toml-path:
required: false
description: Path to the pyporject toml
default: "./pyproject.toml"
runs:
using: composite
steps:
- name: Get project version with yq
id: get_python_version
uses: mikefarah/yq@v4.46.1
with:
cmd: yq '.project.requires-python' ${{ inputs.pyproject-toml-path }}
- name: Set up Python
uses: actions/setup-python@v5.6.0
with:
python-version: ${{ steps.get_python_version.outputs.result }}
- name: Cache Env
uses: actions/cache@v4.2.3
id: env-cache
with:
path: ${{ env.pythonLocation }}
key: ${{ hashFiles('./requirements/requirements.txt') }}-${{ hashFiles('./requirements/requirements_test.txt') }}
- name: Install Dependencies
if: ${{ steps.env-cache.outputs.cache-hit != 'true' }}
run: |
python -m pip install --upgrade pip
pip install -r requirements/requirements.txt
pip install -r requirements/requirements_test.txt
shell: bash