Skip to content

Targeted Platform Testing #3

Targeted Platform Testing

Targeted Platform Testing #3

Workflow file for this run

name: Targeted Platform Testing
on:
workflow_dispatch:
inputs:
platform:
description: 'Platform to test on'
required: true
type: choice
options:
- 'windows-2025'
- 'ubuntu-24.04'
- 'ubuntu-24.04-arm'
- 'macos-15'
- 'macos-15-intel'
python_version:
description: 'Python version to test'
required: true
type: choice
options:
- '3.9'
- '3.10'
- '3.11'
- '3.12'
- '3.13'
- '3.14'
testsuite:
description: 'Test suite to run (ignored if custom_test_path is provided)'
required: false
type: choice
options:
- 'fast'
- 'all'
default: 'fast'
custom_test_path:
description: 'Custom test path (must be in tests/ directory, overrides testsuite)'
required: false
type: string
jobs:
test:
name: 'Test with Python ${{ inputs.python_version }} on ${{ inputs.platform }}'
runs-on: ${{ inputs.platform }}
steps:
- name: Checkout DuckDB Python
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "0.9.0"
enable-cache: false
python-version: ${{ inputs.python_version }}
- name: Set and validate test path
id: test_path
shell: bash
run: |
if [[ -n "${{ inputs.custom_test_path }}" ]]; then
test_path="${{ inputs.custom_test_path }}"
# Check if path exists and is within tests/ directory
if ! cd "$test_path" 2>/dev/null; then
echo "::error::Test path does not exist: $test_path"
exit 1
fi
# Check if current directory is within tests/
current_dir="$(pwd)"
expected_prefix="$GITHUB_WORKSPACE/tests"
if [[ "$current_dir" != "$expected_prefix"* ]]; then
echo "::error::Test path must be within the tests/ directory"
exit 1
fi
echo "path=$test_path" >> $GITHUB_OUTPUT
else
# Use testsuite parameter
case "${{ inputs.testsuite }}" in
"fast")
echo "path=tests/fast" >> $GITHUB_OUTPUT
;;
"all")
echo "path=tests" >> $GITHUB_OUTPUT
;;
esac
fi
- name: Run tests
shell: bash
run: |
uv run pytest -vv ${{ steps.test_path.outputs.path }}