Skip to content

Commit 0e6f4a5

Browse files
committed
[DEVOPS-584] convert python verion to pixi env name
1 parent f364416 commit 0e6f4a5

3 files changed

Lines changed: 13 additions & 5 deletions

File tree

.github/actions/reusable-python-setup_pixi/action.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ inputs:
55
description: 'Cache number to reset cache if pixi.lock has not changed'
66
required: true
77
type: number
8-
pixi-env:
9-
description: 'Name of the pixi environment to create'
8+
python-version:
9+
description: 'Python version to decide on the pixi environment to install'
1010
required: true
1111
type: string
1212
JFROG_ARTIFACTORY_URL:
@@ -21,10 +21,18 @@ inputs:
2121
runs:
2222
using: "composite"
2323
steps:
24+
- id: get-env-name
25+
name: Get pixi environment name
26+
shell: bash
27+
env:
28+
PYTHON_VERSION: ${{ inputs.python-version }}
29+
run: |
30+
pixi_env="py${PYTHON_VERSION//./}"
31+
echo "pixi-env=$pixi_env" >> "$GITHUB_OUTPUT"
2432
- uses: prefix-dev/setup-pixi@v0.9.0
2533
with:
2634
pixi-version: v0.54.1
27-
environment: ${{ inputs.pixi-env }}
35+
environment: ${{ steps.get-env-name.outputs.pixi-env }}
2836
cache-key: pixi-env{{ inputs.cache-number }}
2937
cache: true
3038
locked: true

.github/workflows/reusable-python-pytest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ jobs:
118118
if: ${{ inputs.package-manager == 'pixi' }}
119119
with:
120120
cache-number: ${{ inputs.cache-number }}
121-
pixi-env: ${{ inputs.python-version }}
121+
python-version: ${{ matrix.python-version }}
122122
JFROG_ARTIFACTORY_URL: ${{ secrets.JFROG_ARTIFACTORY_URL }}
123123
JFROG_ARTIFACTORY_TOKEN: ${{ secrets.JFROG_ARTIFACTORY_TOKEN }}
124124

.github/workflows/reusable-python-static_analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ jobs:
105105
if: ${{ inputs.package-manager == 'pixi' }}
106106
with:
107107
cache-number: ${{ inputs.cache-number }}
108-
pixi-env: ${{ inputs.python-version }}
108+
python-version: ${{ inputs.python-version }}
109109
JFROG_ARTIFACTORY_URL: ${{ secrets.JFROG_ARTIFACTORY_URL }}
110110
JFROG_ARTIFACTORY_TOKEN: ${{ secrets.JFROG_ARTIFACTORY_TOKEN }}
111111

0 commit comments

Comments
 (0)