File tree Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change
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
You can’t perform that action at this time.
0 commit comments