Skip to content

Commit df06a44

Browse files
Merge pull request #401 from ZeroGachis/task/PLA-2800-add-poetry-install-action
feat: Add action to install the python dependencies of a project with poetry
2 parents 788c915 + 518ee0c commit df06a44

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Poetry install dependencies
2+
description: |
3+
Install python dependencies dependencies with poetry.
4+
5+
This action login on AWS in order to install
6+
Smartway's private packages from AWS CodeArtifact.
7+
8+
Installed dependencies are cached.
9+
10+
Prerequisites: Python & poetry must be installed, and
11+
the repository must be checked-out.
12+
13+
inputs:
14+
aws_account_id:
15+
required: true
16+
install_options:
17+
required: false
18+
19+
runs:
20+
using: "composite"
21+
steps:
22+
- name: Define a cache for the virtual environment based on the dependencies lock file
23+
uses: actions/cache@v5
24+
id: cache-python-deps
25+
with:
26+
path: ./.venv
27+
key: venv-${{ runner.os }}-${{ hashFiles('poetry.lock') }}-${{ inputs.install_options }}
28+
- name: Authenticate on AWS
29+
if: steps.cache-python-deps.outputs.cache-hit != 'true'
30+
id: aws
31+
uses: aws-actions/configure-aws-credentials@v5
32+
with:
33+
aws-region: eu-west-3
34+
role-to-assume: arn:aws:iam::${{ inputs.aws_account_id }}:role/github_oidc_readonly
35+
output-credentials: true
36+
- name: Setup private repository credentials
37+
run: ./scripts/setup_private_repo_credentials.sh
38+
shell: bash
39+
if: steps.cache-python-deps.outputs.cache-hit != 'true'
40+
- name: Install dependencies
41+
run: poetry install ${{ inputs.install_options }}
42+
shell: bash
43+
if: steps.cache-python-deps.outputs.cache-hit != 'true'

0 commit comments

Comments
 (0)