Skip to content

Commit 14cdfa8

Browse files
authored
📦 Create setup_environment.yml
1 parent 6f77e23 commit 14cdfa8

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# This is the name of the workflow, it appears in the GitHub Actions tab
2+
name: Setup Python Environment
3+
4+
# The name for workflow runs generated from this workflow
5+
run-name: Setup Python Environment Run on ${{ github.ref }} by @${{ github.actor }}
6+
7+
# This specifies the events that will trigger the workflow to run
8+
on:
9+
workflow_call:
10+
inputs:
11+
python-version:
12+
required: true
13+
type: string
14+
15+
# Jobs define the actual tasks that the workflow will execute
16+
jobs:
17+
setup:
18+
runs-on: ubuntu-latest
19+
outputs:
20+
python-version: ${{ steps.setup-python.outputs.python-version }}
21+
22+
steps:
23+
# Checkout the repository content to the runner
24+
- uses: actions/checkout@v4
25+
26+
- name: Install Poetry
27+
run: |
28+
curl -sSL https://install.python-poetry.org | python3 -
29+
30+
# Setup Python environment
31+
- name: Setup Python
32+
id: setup-python
33+
uses: actions/setup-python@v5
34+
with:
35+
python-version: ${{ inputs.python-version }}
36+
cache: 'poetry'
37+
38+
- name: Generate requirements.txt from Poetry
39+
run: |
40+
poetry export -f requirements.txt --output requirements.txt --without-hashes
41+
42+
# Install Python dependencies
43+
- name: Install Dependencies
44+
run: |
45+
python -m pip install --upgrade pip
46+
pip install -r requirements.txt

0 commit comments

Comments
 (0)