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