Skip to content

Commit

Permalink
ci: use pdm-project/setup-pdm
Browse files Browse the repository at this point in the history
  • Loading branch information
mkniewallner committed Mar 12, 2024
1 parent d05ff29 commit 9bd61b3
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions .github/actions/setup-env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ inputs:
python-version:
description: 'Python version for setup-python'
required: true
default: 3.11
default: '3.11'
pdm-version:
description: 'PDM version to install'
required: true
default: '2.12.4'
target:
description: 'Target architecture for maturin'
required: true
Expand All @@ -18,29 +22,27 @@ inputs:
runs:
using: 'composite'
steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
architecture: ${{ matrix.python-target }}

- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.75.0

- name: Install PDM and dependencies
- name: Install PDM
uses: pdm-project/setup-pdm@v4
with:
version: ${{ inputs.pdm-version }}
python-version: ${{ inputs.python-version }}
architecture: ${{ inputs.python-target }}
cache: true

- name: Install Python dependencies
run: |
python -m pip install pdm
python -m venv .venv
if [ "${{ runner.os }}" = "Windows" ]; then
source .venv/Scripts/Activate
else
source .venv/bin/activate
fi
python -m pip install --upgrade pip
pdm config python.use_venv true
pdm install
pdm install --no-lock --no-editable
shell: bash

- name: Activate PDM virtual environment
run: pdm venv activate
shell: bash

- name: Build and install the project using Maturin
Expand Down

0 comments on commit 9bd61b3

Please sign in to comment.