Skip to content

Commit f0344ad

Browse files
committed
CI: add install requirements
1 parent 580661a commit f0344ad

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
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/publish-pypi.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ jobs:
1212
upload:
1313
runs-on: ubuntu-latest
1414
environment: release
15+
strategy:
16+
matrix:
17+
python-version: ["3.12"]
1518

1619
steps:
1720

0 commit comments

Comments
 (0)