-
Notifications
You must be signed in to change notification settings - Fork 2
/
action.yml
26 lines (26 loc) · 1.07 KB
/
action.yml
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
name: Setup the Python dependencies
description: This composite run steps require the dependencies cache before running.
inputs:
python-version:
description: Python version to use.
required: true
runs:
using: composite
steps:
- name: Set the Python version
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python-version }}
- name: Set the site package path to the environment variables
run: python -c "import site; print(f'site-packages-path={site.getsitepackages()[0]}')" >> $GITHUB_ENV
shell: bash
- name: Restore the Python package cache
uses: actions/cache@v3
with:
path: ${{ env.site-packages-path }}
key: ${{ runner.os }}-pip-${{ env.site-packages-path }}-${{ hashFiles('**/requirements.txt') }}
- name: Restore the bin cache
uses: actions/cache@v3
with:
path: /opt/hostedtoolcache/Python/${{ inputs.python-version }}/x64/bin/
key: ${{ runner.os }}-bin-cache-${{ env.site-packages-path }}-${{ hashFiles('**/requirements.txt') }}