Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
90f7a4c
[DEVOPS-584] Add pixi to pytest and pylint workflows
Dec 19, 2024
de9d41f
[DEVOPS-584] Run pixi install --frozen instead of pixi install --locked
Dec 19, 2024
71334b4
[DEVOPS-584] Add a build pixi package workflow
Dec 20, 2024
247eaba
Add GIT_LFS_SKIP_SMUDGE environment variable
saicheranb Sep 3, 2025
d2b5118
[DEVOPS-584] Merge remote-tracking branch 'upstream/main' into DEVOPS…
sebhmg Sep 4, 2025
62b1126
[DEVOPS-584] update setup-pixi action and pix version
sebhmg Sep 4, 2025
0697e0c
[DEVOPS-584] pixi install --locked instead of --frozen
sebhmg Sep 4, 2025
c75e48b
[DEVOPS-584] removing pixi build. Can still use poetry build
sebhmg Sep 4, 2025
a493e48
[DEVOPS-584] minor fix in comment
sebhmg Sep 4, 2025
bf0e404
[DEVOPS-584] use cache number to reset cache
sebhmg Sep 4, 2025
0c6a64f
[DEVOPS-584] no need to check python version: pixi manages it all
sebhmg Sep 4, 2025
0e197d3
[DEVOPS-584] remove unused input from pixi shared action
sebhmg Sep 4, 2025
f2c6639
[DEVOPS-584] pass cache number to shared actions
sebhmg Sep 4, 2025
4755d16
[DEVOPS-584] aesthetics
sebhmg Sep 4, 2025
516a1c0
[DEVOPS-584] input for pixi env
sebhmg Sep 4, 2025
c6a8f01
[DEVOPS-584] pass credentials to pixi for Artifactory
sebhmg Sep 4, 2025
49e2b30
[DEVOPS-584] fix wrong input description
sebhmg Sep 4, 2025
a45e21c
[DEVOPS-584] convert python verion to pixi env name
sebhmg Sep 4, 2025
ca1af4e
[DEVOPS-584] accessing Artifactory is not necessarily required for pixi
sebhmg Sep 4, 2025
22e1e54
[DEVOPS-584] activate the pixi environment
sebhmg Sep 4, 2025
e6176e0
[DEVOPS-584] pixi and micromamba do not need a pre-installed python
sebhmg Sep 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/actions/reusable-python-setup_conda/action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Setup conda env
description: Setup conda environment for Python
inputs:
cache-number:
description: 'Cache number to reset cache if conda lock file has not changed'
required: true
type: number
python-version:
description: 'Python version to use'
required: true
Expand Down Expand Up @@ -32,6 +36,7 @@ runs:
micromamba-version: ${{ env.micromamba_version }}
init-shell: bash
cache-downloads: true
cache-downloads-key: micromamba-dl${{ inputs.cache-number }}
environment-name: ""
post-cleanup: none
- name: Authenticate to Artifactory
Expand All @@ -47,6 +52,7 @@ runs:
environment-name: test_env
init-shell: bash
cache-downloads: true
cache-downloads-key: micromamba-dl${{ inputs.cache-number }}
post-cleanup: none
env:
PYTHONUTF8: 1
Expand Down
44 changes: 44 additions & 0 deletions .github/actions/reusable-python-setup_pixi/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Setup pixi env
description: Setup pixi environment for Python
inputs:
cache-number:
description: 'Cache number to reset cache if pixi.lock has not changed'
required: true
type: number
python-version:
description: 'Python version to decide on the pixi environment to install'
required: false
type: string
JFROG_ARTIFACTORY_URL:
description: 'JFrog Artifactory URL'
required: true
type: string
JFROG_ARTIFACTORY_TOKEN:
description: 'JFrog Artifactory Token'
required: false
type: string

runs:
using: "composite"
steps:
- id: get-env-name
name: Get pixi environment name
shell: bash
env:
PYTHON_VERSION: ${{ inputs.python-version }}
run: |
pixi_env="py${PYTHON_VERSION//./}"
echo "pixi-env=$pixi_env" >> "$GITHUB_OUTPUT"
- uses: prefix-dev/setup-pixi@v0.9.0
with:
pixi-version: v0.54.1
environments: ${{ steps.get-env-name.outputs.pixi-env }}
activate-environment: true
cache-key: pixi-env${{ inputs.cache-number }}
cache: true
locked: true
auth-host: ${{ inputs.JFROG_ARTIFACTORY_URL }}
auth-username: ${{ inputs.JFROG_ARTIFACTORY_TOKEN && 'github' || '' }}
auth-password: ${{ inputs.JFROG_ARTIFACTORY_TOKEN }}
env:
GIT_LFS_SKIP_SMUDGE: 1
19 changes: 16 additions & 3 deletions .github/workflows/reusable-python-pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_call:
inputs:
package-manager:
description: 'Package manager to use (e.g. "conda", "poetry")'
description: 'Package manager to use (e.g. "conda", "poetry", "pixi")'
required: true
type: string
default: 'poetry'
Expand Down Expand Up @@ -37,7 +37,7 @@ on:
required: false
type: string
virtual-repo-names:
description: 'List of repository names to publish on (e.g. ["public-dev-pypi"])'
description: 'List of repository names to resolve on (e.g. ["public-dev-pypi"])'
required: false
type: string
lfs:
Expand Down Expand Up @@ -84,13 +84,15 @@ jobs:

- name: Set up Python version
uses: actions/setup-python@v5
if: ${{ inputs.package-manager == 'poetry' || inputs.package-manager == 'hatch' }}
with:
python-version: ${{ matrix.python-version }}

- uses: MiraGeoscience/CI-tools/.github/actions/reusable-python-setup_conda@main
- uses: MiraGeoscience/CI-tools/.github/actions/reusable-python-setup_conda@DEVOPS-584
name: Setup conda env
if: ${{ inputs.package-manager == 'conda' }}
with:
cache-number: ${{ inputs.cache-number }}
python-version: ${{ matrix.python-version }}
JFROG_ARTIFACTORY_URL: ${{ secrets.JFROG_ARTIFACTORY_URL }}
JFROG_ARTIFACTORY_TOKEN: ${{ secrets.JFROG_ARTIFACTORY_TOKEN }}
Expand All @@ -112,12 +114,23 @@ jobs:
cache-number: ${{ inputs.cache-number }}
runner-os: ${{ runner.os }}

- uses: MiraGeoscience/CI-tools/.github/actions/reusable-python-setup_pixi@DEVOPS-584
name: Setup pixi env
if: ${{ inputs.package-manager == 'pixi' }}
with:
cache-number: ${{ inputs.cache-number }}
python-version: ${{ matrix.python-version }}
JFROG_ARTIFACTORY_URL: ${{ secrets.JFROG_ARTIFACTORY_URL }}
JFROG_ARTIFACTORY_TOKEN: ${{ secrets.JFROG_ARTIFACTORY_TOKEN }}

- name: Run Pytest
run: |
if ${{ inputs.package-manager == 'conda' }}; then
pytest --cov --cov-report=xml
elif ${{ inputs.package-manager == 'poetry' }}; then
poetry run pytest --cov --cov-report=xml
elif ${{ inputs.package-manager == 'pixi' }}; then
pixi run pytest --cov --cov-report=xml
else
hatch run pytest --cov --cov-report=xml
fi
Expand Down
24 changes: 20 additions & 4 deletions .github/workflows/reusable-python-static_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_call:
inputs:
package-manager:
description: 'Package manager to use (e.g. "conda", "poetry")'
description: 'Package manager to use (e.g. "conda", "poetry", "pixi")'
required: true
type: string
default: 'poetry'
Expand Down Expand Up @@ -68,15 +68,18 @@ jobs:
with:
lfs: ${{ inputs.lfs }}
fetch-depth: 0

- name: Set up Python version
uses: actions/setup-python@v5
if: ${{ inputs.package-manager == 'poetry' || inputs.package-manager == 'hatch' }}
with:
python-version: ${{inputs.python-version}}

- uses: MiraGeoscience/CI-tools/.github/actions/reusable-python-setup_conda@main
- uses: MiraGeoscience/CI-tools/.github/actions/reusable-python-setup_conda@DEVOPS-584
name: Setup conda env
if: ${{ inputs.package-manager == 'conda' }}
with:
cache-number: ${{ inputs.cache-number }}
python-version: ${{ inputs.python-version }}
JFROG_ARTIFACTORY_URL: ${{ secrets.JFROG_ARTIFACTORY_URL }}
JFROG_ARTIFACTORY_TOKEN: ${{ secrets.JFROG_ARTIFACTORY_TOKEN }}
Expand All @@ -85,7 +88,7 @@ jobs:
name: Setup poetry env
if: ${{ inputs.package-manager == 'poetry' }}
with:
cache-number: 1
cache-number: ${{ inputs.cache-number }}
runner-os: ${{ runner.os }}
install-extras: ${{ inputs.install-extras }}
virtual-repo-names: ${{ inputs.virtual-repo-names }}
Expand All @@ -95,9 +98,18 @@ jobs:
name: Setup hatch env
if: ${{ inputs.package-manager == 'hatch' }}
with:
cache-number: 1
cache-number: ${{ inputs.cache-number }}
runner-os: ${{ runner.os }}

- uses: MiraGeoscience/CI-tools/.github/actions/reusable-python-setup_pixi@DEVOPS-584
name: Setup pixi env
if: ${{ inputs.package-manager == 'pixi' }}
with:
cache-number: ${{ inputs.cache-number }}
python-version: ${{ inputs.python-version }}
JFROG_ARTIFACTORY_URL: ${{ secrets.JFROG_ARTIFACTORY_URL }}
JFROG_ARTIFACTORY_TOKEN: ${{ secrets.JFROG_ARTIFACTORY_TOKEN }}

- name: Capture modified files
if: github.event_name == 'pull_request'
run: >-
Expand All @@ -113,6 +125,8 @@ jobs:
pylint $FILES_PARAM
elif ${{ inputs.package-manager == 'poetry' }}; then
poetry run pylint $FILES_PARAM
elif ${{ inputs.package-manager == 'pixi' }}; then
pixi run pylint $FILES_PARAM
else
hatch run pylint $FILES_PARAM
fi
Expand All @@ -124,6 +138,8 @@ jobs:
pylint $source_dir tests
elif ${{ inputs.package-manager == 'poetry' }}; then
poetry run pylint $source_dir tests
elif ${{ inputs.package-manager == 'pixi' }}; then
pixi run pylint $source_dir tests
else
hatch run pylint $source_dir tests
fi