Skip to content

Targeted Platform Testing #1

Targeted Platform Testing

Targeted Platform Testing #1

Workflow file for this run

name: Targeted Platform Testing
on:
workflow_dispatch:
inputs:
platform:
description: 'Platform to test on'
required: true
type: choice
options:
- 'linux-x86_64'
- 'linux-aarch64'
- 'windows-amd64'
- 'osx-x86_64'
- 'osx-arm64'
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: ${{ inputs.python_version }}-${{ matrix.platform.id }}'
strategy:
matrix:
platform:
- { os: windows-2025, arch: amd64, id: windows-amd64 }
- { os: ubuntu-24.04, arch: x86_64, id: linux-x86_64 }
- { os: ubuntu-24.04-arm, arch: aarch64, id: linux-aarch64 }
- { os: macos-15, arch: arm64, id: osx-arm64 }
- { os: macos-15-intel, arch: x86_64, id: osx-x86_64 }
exclude:
- platform: { id: windows-amd64 }
- platform: { id: linux-x86_64 }
- platform: { id: linux-aarch64 }
- platform: { id: osx-arm64 }
- platform: { id: osx-x86_64 }
include:
- platform: { id: "${{ inputs.platform }}" }
runs-on: ${{ matrix.platform.os }}
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 }}