-
Notifications
You must be signed in to change notification settings - Fork 140
Expand file tree
/
Copy pathaction.yml
More file actions
63 lines (55 loc) · 2.19 KB
/
action.yml
File metadata and controls
63 lines (55 loc) · 2.19 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Setup Poetry with JFrog
description: Install Poetry, configure JFrog as primary PyPI source, and install project dependencies
inputs:
python-version:
description: Python version to set up
required: true
install-args:
description: Extra arguments for poetry install (e.g. --all-extras)
required: false
default: ""
cache-path:
description: Path to the virtualenv for caching (e.g. .venv or .venv-pyarrow)
required: false
default: ".venv"
cache-suffix:
description: Extra suffix for the cache key to avoid collisions across job variants
required: false
default: ""
runs:
using: composite
steps:
- name: Setup JFrog
uses: ./.github/actions/setup-jfrog
- name: Set up python ${{ inputs.python-version }}
id: setup-python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: ${{ inputs.python-version }}
- name: Install Poetry
shell: bash
run: |
pip install poetry==2.2.1
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
poetry config installer.parallel true
- name: Configure Poetry JFrog source
shell: bash
run: |
poetry config repositories.jfrog https://databricks.jfrog.io/artifactory/api/pypi/db-pypi/simple
poetry config http-basic.jfrog gha-service-account "${JFROG_ACCESS_TOKEN}"
poetry source add --priority=primary jfrog https://databricks.jfrog.io/artifactory/api/pypi/db-pypi/simple
poetry lock
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: ${{ inputs.cache-path }}
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ inputs.cache-suffix }}${{ github.event.repository.name }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
shell: bash
run: poetry install --no-interaction --no-root
- name: Install library
shell: bash
run: poetry install --no-interaction ${{ inputs.install-args }}