From a4f9bf3407e6876fc7fec47d9ab1f7084be3a732 Mon Sep 17 00:00:00 2001 From: Thomas Schmelzer Date: Sat, 4 Jan 2025 16:42:31 +0400 Subject: [PATCH] towards complete tests --- actions/uv/coverage/action.yml | 39 +++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/actions/uv/coverage/action.yml b/actions/uv/coverage/action.yml index b27f9f99..a4ba55b6 100644 --- a/actions/uv/coverage/action.yml +++ b/actions/uv/coverage/action.yml @@ -24,15 +24,44 @@ inputs: description: 'Directory where the Python project is located' required: false default: '.' + python-version: + description: 'Python version to use' + required: false + default: '3.12' runs: using: "composite" steps: - - name: Set up Python environment - uses: ${{ github.action_path }}/actions/uv/setup - with: - python-version: '3.12' - working-directory: ${{ inputs.working-directory }} + - name: Install uv + shell: bash + run: | + curl -LsSf https://astral.sh/uv/install.sh | sh + echo "$HOME/.cargo/bin" >> $GITHUB_PATH + + - name: Set up Python environment with uv + shell: bash + working-directory: ${{ inputs.working-directory }} + run: | + # Create venv with specific Python version + uv venv --python ${{ inputs.python-version }} + # Add venv to PATH + echo ".venv/bin" >> $GITHUB_PATH + + - name: Install project dependencies + shell: bash + working-directory: ${{ inputs.working-directory }} + run: | + uv python install ${{ inputs.python-version }} + uv sync --all-extras --dev --frozen + + # Install coverage tools separately to ensure they don't conflict + uv pip install --upgrade pytest pytest-cov coverage + + #- name: Set up Python environment + # uses: ${{ github.action_path }}/actions/uv/setup + # with: + # python-version: '3.12' + # working-directory: ${{ inputs.working-directory }} - name: Run tests with coverage shell: bash