Skip to content
This repository was archived by the owner on Jul 14, 2025. It is now read-only.

Commit 7d90e93

Browse files
author
Evert
committed
parity with v1.3-ossivalis
1 parent 79558d8 commit 7d90e93

File tree

166 files changed

+3216
-1061
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

166 files changed

+3216
-1061
lines changed

.github/workflows/coverage.yml

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
name: Test coverage
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
git_ref:
6+
type: string
7+
description: Git ref of the DuckDB python package
8+
default: refs/heads/main
9+
required: true
10+
duckdb_git_ref:
11+
type: string
12+
description: Git ref of DuckDB
13+
testsuite:
14+
type: choice
15+
description: Testsuite to run ('all' or 'fast')
16+
default: all
17+
required: true
18+
options:
19+
- all
20+
- fast
21+
workflow_call:
22+
inputs:
23+
git_ref:
24+
type: string
25+
description: Git ref of the DuckDB python package
26+
required: true
27+
duckdb_git_ref:
28+
type: string
29+
testsuite:
30+
type: string
31+
description: Testsuite to run ('all' or 'fast')
32+
required: true
33+
default: all
34+
35+
concurrency:
36+
group: ${{ github.workflow }}-${{ github.ref }}
37+
cancel-in-progress: true
38+
39+
jobs:
40+
generate_coverage_reports:
41+
name: Generate code coverage reports for both Python and C++ code
42+
runs-on: ubuntu-24.04
43+
env: { COVERAGE: 1 }
44+
outputs:
45+
summary_py: ${{ steps.py_coverage.outputs.summary }}
46+
summary_cpp: ${{ steps.cpp_coverage.outputs.summary }}
47+
steps:
48+
49+
- uses: actions/checkout@v4
50+
with:
51+
ref: ${{ inputs.git_ref }}
52+
fetch-depth: 0
53+
submodules: true
54+
55+
- name: Checkout DuckDB to provided ref
56+
if: ${{ inputs.duckdb_git_ref != '' }}
57+
shell: bash
58+
run: |
59+
cd external/duckdb
60+
git fetch origin
61+
git checkout ${{ inputs.duckdb_git_ref }}
62+
63+
- name: Set DuckDB to HEAD if no ref provided
64+
if: ${{ inputs.duckdb_git_ref == '' }}
65+
run: git submodule update --remote
66+
67+
- name: Install Ccache
68+
shell: bash
69+
run: |
70+
sudo apt-get update
71+
sudo apt-get -y install ccache
72+
73+
- name: Install Astral UV and enable the cache
74+
uses: astral-sh/setup-uv@v6
75+
with:
76+
version: "0.7.14"
77+
python-version: 3.9
78+
enable-cache: true
79+
cache-suffix: -${{ github.workflow }}
80+
81+
- name: Run tests with coverage
82+
shell: bash
83+
run: |
84+
if [[ "${{ inputs.testsuite }}" == "all" ]]; then
85+
uv run -v coverage run -m pytest ./tests --ignore=./tests/stubs
86+
elif [[ "${{ inputs.testsuite }}" == "fast" ]]; then
87+
uv run -v coverage run -m pytest ./tests/fast
88+
else
89+
echo "Invalid testsuite!"
90+
exit 1
91+
fi
92+
93+
- name: Get Python coverage data
94+
id: py_coverage
95+
shell: bash
96+
run: |
97+
# save HTML report in coverage-python
98+
uv run coverage html -d coverage-python
99+
# save markdown summary in step output
100+
echo "summary<<EOF" >> $GITHUB_OUTPUT
101+
uv run coverage report --format=markdown >> $GITHUB_OUTPUT
102+
echo "EOF" >> $GITHUB_OUTPUT
103+
104+
- name: Upload Python coverage report
105+
uses: actions/upload-artifact@v4
106+
with:
107+
name: coverage-report-python
108+
path: coverage-python
109+
110+
- name: Get C++ coverage data
111+
id: cpp_coverage
112+
shell: bash
113+
run: |
114+
mkdir coverage-cpp
115+
uv run gcovr \
116+
--gcov-ignore-errors all \
117+
--root "$PWD" \
118+
--filter "${PWD}/src/duckdb_py" \
119+
--exclude '.*/\.cache/.*' \
120+
--gcov-exclude '.*/\.cache/.*' \
121+
--gcov-exclude '.*/external/.*' \
122+
--gcov-exclude '.*/site-packages/.*' \
123+
--exclude-unreachable-branches \
124+
--exclude-throw-branches \
125+
--html --html-details -o coverage-cpp/index.html \
126+
build/coverage/src/duckdb_py \
127+
--print-summary > cpp_summary.txt
128+
# save the summary in the output
129+
echo "summary<<EOF" >> $GITHUB_OUTPUT
130+
cat cpp_summary.txt >> $GITHUB_OUTPUT
131+
echo "EOF" >> $GITHUB_OUTPUT
132+
133+
- name: Upload C++ coverage report
134+
uses: actions/upload-artifact@v4
135+
with:
136+
name: coverage-report-cpp
137+
path: coverage-cpp
138+
139+
summary:
140+
name: Coverage Summary
141+
runs-on: ubuntu-24.04
142+
needs: [generate_coverage_reports]
143+
env:
144+
SUMMARY_PY: ${{ needs.generate_coverage_reports.outputs.summary_py }}
145+
SUMMARY_CPP: ${{ needs.generate_coverage_reports.outputs.summary_cpp }}
146+
if: always()
147+
steps:
148+
- name: Summarize
149+
shell: bash
150+
run: |
151+
echo "## Coverage Summary" >> $GITHUB_STEP_SUMMARY
152+
echo "### Python Coverage Summary" >> $GITHUB_STEP_SUMMARY
153+
echo "$SUMMARY_PY" >> $GITHUB_STEP_SUMMARY
154+
echo "### C++ Coverage Summary" >> $GITHUB_STEP_SUMMARY
155+
echo '```' >> $GITHUB_STEP_SUMMARY
156+
echo "$SUMMARY_CPP" >> $GITHUB_STEP_SUMMARY
157+
echo '```' >> $GITHUB_STEP_SUMMARY

.github/workflows/on_pr.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Tests and builds on PR
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
- v*.*-*
7+
types: [opened, reopened, ready_for_review, converted_to_draft]
8+
paths-ignore:
9+
- '**.md'
10+
- 'LICENSE'
11+
- '.editorconfig'
12+
- 'scripts/**'
13+
- '.github//**'
14+
- '!.github/workflows/on_push.yml'
15+
- '!.github/workflows/coverage.yml'
16+
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.ref }}
19+
cancel-in-progress: true
20+
21+
jobs:
22+
packaging_test:
23+
name: Build a minimal set of packages and run all tests on them
24+
# Skip packaging tests for draft PRs
25+
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
26+
uses: ./.github/workflows/pypi_packaging.yml
27+
with:
28+
minimal: true
29+
testsuite: all
30+
git_ref: ${{ github.ref }}
31+
duckdb_git_ref: ${{ github.ref_name }}
32+
33+
coverage_test:
34+
name: Run coverage tests
35+
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
36+
uses: ./.github/workflows/coverage.yml
37+
with:
38+
git_ref: ${{ github.ref }}
39+
testsuite: all

.github/workflows/on_push.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Tests and coverage on push
2+
on:
3+
push:
4+
branches-ignore:
5+
- main
6+
- v*.*-*
7+
paths-ignore:
8+
- '**.md'
9+
- 'LICENSE'
10+
- '.editorconfig'
11+
- 'scripts/**'
12+
- '.github//**'
13+
- '!.github/workflows/on_push.yml'
14+
- '!.github/workflows/coverage.yml'
15+
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.ref }}
18+
cancel-in-progress: true
19+
20+
jobs:
21+
test:
22+
name: Run coverage tests
23+
uses: ./.github/workflows/coverage.yml
24+
with:
25+
git_ref: ${{ github.ref }}
26+
testsuite: fast
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Testing and packaging for post releases
2+
on:
3+
push:
4+
branches:
5+
- v*.*.*-post*
6+
paths-ignore:
7+
- '**.md'
8+
- 'LICENSE'
9+
- '.editorconfig'
10+
- 'scripts/**'
11+
- '.github//**'
12+
- '!.github/workflows/on_push.yml'
13+
- '!.github/workflows/coverage.yml'
14+
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
extract_duckdb_tag:
21+
runs-on: ubuntu-24.04
22+
outputs:
23+
duckdb_version: ${{ steps.extract_version.outputs.version }}
24+
steps:
25+
- name: Get DuckDB version from branch name
26+
id: extract_version
27+
shell: bash
28+
run: |
29+
BRANCH="${{ github.ref_name }}"
30+
VERSION="${BRANCH%%-*}"
31+
echo "version=$VERSION" >> $GITHUB_OUTPUT
32+
33+
packaging_test:
34+
name: Build and test post release packages and upload to S3
35+
needs: extract_duckdb_tag
36+
uses: ./.github/workflows/pypi_packaging.yml
37+
with:
38+
minimal: false
39+
testsuite: all
40+
git_ref: ${{ github.ref }}
41+
duckdb_git_ref: ${{ needs.extract_duckdb_tag.outputs.duckdb_version }}
42+
force_version: ${{ github.ref_name }}

0 commit comments

Comments
 (0)