Skip to content

Commit a7ff6ed

Browse files
committed
Add install requirements action
1 parent 0a0af6e commit a7ff6ed

File tree

2 files changed

+34
-3
lines changed

2 files changed

+34
-3
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Install requirements
2+
description: Install a version of python then call pip install and report what was installed
3+
inputs:
4+
python-version:
5+
description: Python version to install, default is from Dockerfile
6+
default: "dev"
7+
pip-install:
8+
description: Parameters to pass to pip install
9+
default: "$([ -f dev-requirements.txt ] && echo '-c dev-requirements.txt') -e .[dev]"
10+
11+
runs:
12+
using: composite
13+
steps:
14+
- name: Get version of python
15+
run: |
16+
PYTHON_VERSION="${{ inputs.python-version }}"
17+
if [ $PYTHON_VERSION == "dev" ]; then
18+
PYTHON_VERSION=$(sed -n "s/ARG PYTHON_VERSION=//p" Dockerfile)
19+
fi
20+
echo "PYTHON_VERSION=$PYTHON_VERSION" >> "$GITHUB_ENV"
21+
shell: bash
22+
23+
- name: Setup python
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: ${{ env.PYTHON_VERSION }}
27+
28+
- name: Install packages
29+
run: pip install ${{ inputs.pip-install }}
30+
shell: bash
31+
32+
- name: Report what was installed
33+
run: pip freeze
34+
shell: bash

.github/workflows/_integration.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ jobs:
2424
run: |
2525
python -m pip install --upgrade pip
2626
pip install .[dev]
27-
- name: Linting
28-
run: |
29-
tox -e pre-commit
3027
- name: Test with pytest
3128
env:
3229
CONFIG_PATH: /home/runner/work/pato-backend/pato-backend/config.json

0 commit comments

Comments
 (0)