Skip to content

Commit 29aa867

Browse files
♻️ Derive requirements from working-directory
1 parent cfede85 commit 29aa867

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

action.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@ inputs:
1414
required: true
1515
default: '3.10'
1616

17-
python-requirements-dir:
18-
description: Path to directory with requirements file(s) to install
19-
required: false
20-
default: 'requirements/'
21-
2217
optimize-postgres:
2318
description: >
2419
Tune postgres for non-durable but faster tests. Requires 'pg-service' name. Set
@@ -82,11 +77,23 @@ runs:
8277
shell: bash
8378
working-directory: ${{ inputs.working-directory }}
8479

80+
- name: Calculate requirements path
81+
id: requirements_path
82+
run: |
83+
if [${{ inputs.working-directory }}]
84+
then
85+
prefix=${{ inputs.working-directory }}/
86+
else
87+
prefix=''
88+
fi
89+
echo "requirements_dir_prefix=${prefix}" >> $GITHUB_OUTPUT
90+
shell: bash
91+
8592
- uses: actions/setup-python@v4
8693
with:
8794
python-version: ${{ inputs.python-version }}
8895
cache: 'pip'
89-
cache-dependency-path: '${{ inputs.python-requirements-dir }}*.txt'
96+
cache-dependency-path: '${{ steps.requirements_path.outputs.requirements_dir_prefix }}requirements/*.txt'
9097

9198
- name: Install backend dependencies
9299
run: |

0 commit comments

Comments
 (0)