forked from duckdb/duckdb-python
-
Notifications
You must be signed in to change notification settings - Fork 0
113 lines (103 loc) · 3.3 KB
/
targeted_test.yml
File metadata and controls
113 lines (103 loc) · 3.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
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 }}