-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
46 lines (44 loc) · 1.41 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: "Setup pip-tools"
description: "Setup python and deps using pip-tools"
inputs:
dependency-path:
description: path to extra requirements
required: false
default: "backend/requirements.txt"
sync:
description: run pip-sync
required: false
default: true
python-version:
description: python version
required: true
pip-version:
description: pip version
required: false
default: "~=23.3.0"
pip-tools-version:
description: pip-tools version
required: false
default: "~=7.3.0"
runs:
using: "composite"
steps:
- uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
- name: Cache dependencies
if: ${{ inputs.sync != 'false' }}
uses: actions/cache@v4
id: cache
with:
path: ${{ env.pythonLocation }}
key: pip-${{ env.pythonLocation }}-${{ hashFiles(inputs.dependency-path) }}
restore-keys: |
pip-${{ env.pythonLocation }}-${{ hashFiles(inputs.dependency-path) }}
pip-${{ env.pythonLocation }}-
- run: pip install --disable-pip-version-check --upgrade "pip${{ inputs.pip-version }}" "pip-tools${{ inputs.pip-tools-version }}" wheel
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
shell: bash
- run: pip-sync ${{ inputs.dependency-path }}
if: ${{ inputs.sync != 'false' && steps.cache.outputs.cache-hit != 'true' }}
shell: bash