Skip to content

Commit c9fa2ad

Browse files
committed
Merge main into test/catalog-statement-count
2 parents 355219b + 131bdea commit c9fa2ad

99 files changed

Lines changed: 2143 additions & 282 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Set up uv
2+
description: >-
3+
Install a pinned uv from PyPI and optionally cache its package cache. Installing from PyPI
4+
keeps setup working when GitHub release downloads fail.
5+
inputs:
6+
version:
7+
description: Exact uv version to install
8+
required: true
9+
enable-cache:
10+
description: Restore and save the uv cache, keyed on the dependency files
11+
required: false
12+
default: "false"
13+
cache-dependency-glob:
14+
description: Files whose contents key the cache, one path per line
15+
required: false
16+
default: uv.lock
17+
runs:
18+
using: composite
19+
steps:
20+
# The runner's cached Python, left off PATH so jobs keep the Python they set up themselves.
21+
- id: python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: "3.12"
25+
update-environment: false
26+
- name: Install uv from PyPI
27+
shell: bash
28+
env:
29+
PYTHON: ${{ steps.python.outputs.python-path }}
30+
UV_VERSION: ${{ inputs.version }}
31+
run: |
32+
package="${RUNNER_TEMP}/uv-package"
33+
"${PYTHON}" -m pip install --disable-pip-version-check --no-warn-script-location \
34+
--target "${package}" "uv==${UV_VERSION}"
35+
mkdir -p "${RUNNER_TEMP}/uv-bin"
36+
for executable in "${package}"/bin/uv* "${package}"/Scripts/uv*; do
37+
if [[ -f "${executable}" ]]; then cp "${executable}" "${RUNNER_TEMP}/uv-bin/"; fi
38+
done
39+
echo "${RUNNER_TEMP}/uv-bin" >> "${GITHUB_PATH}"
40+
"${RUNNER_TEMP}/uv-bin/uv" --version
41+
- id: cache-key
42+
if: inputs.enable-cache == 'true'
43+
name: Key the uv cache on the dependency files
44+
shell: bash
45+
env:
46+
FILES: ${{ inputs.cache-dependency-glob }}
47+
UV_VERSION: ${{ inputs.version }}
48+
run: |
49+
echo "UV_CACHE_DIR=${RUNNER_TEMP}/setup-uv-cache" >> "${GITHUB_ENV}"
50+
digest=$(while IFS= read -r file; do
51+
if [[ -n "${file// /}" ]]; then sha256sum "${file// /}"; fi
52+
done <<< "${FILES}" | sha256sum | cut -c1-64)
53+
echo "key=uv-pypi-${RUNNER_OS}-${RUNNER_ARCH}-${UV_VERSION}-${digest}" >> "${GITHUB_OUTPUT}"
54+
- if: inputs.enable-cache == 'true'
55+
uses: actions/cache@v4
56+
with:
57+
path: ${{ runner.temp }}/setup-uv-cache
58+
key: ${{ steps.cache-key.outputs.key }}

‎.github/workflows/benchmark-dbt.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
shell: bash
7171
steps:
7272
- uses: actions/checkout@v4
73-
- uses: astral-sh/setup-uv@v5
73+
- uses: ./.github/actions/setup-uv
7474
with:
7575
version: "0.12.3"
7676
- name: Validate inputs

‎.github/workflows/build-distributions.yml‎

Lines changed: 95 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,13 @@ jobs:
141141
run: |
142142
npm ci
143143
npm run build
144-
- uses: PyO3/maturin-action@v1
144+
# maturin-action downloads maturin from GitHub releases, which can fail on its own. Each
145+
# build retries once; macOS and Windows then fall back to the same maturin from PyPI. Linux
146+
# builds need the action's manylinux container, so they have no fallback.
147+
- id: extension
148+
uses: PyO3/maturin-action@v1
145149
if: inputs.prebuilt-run-id == ''
150+
continue-on-error: true
146151
with:
147152
command: build
148153
# One platform records a cargo build timing report for build time work.
@@ -151,8 +156,33 @@ jobs:
151156
${{ matrix.platform.name == 'linux-x86_64' && '--timings' || '' }}
152157
target: ${{ matrix.platform.target }}
153158
manylinux: auto
154-
- uses: PyO3/maturin-action@v1
159+
- id: extension-retry
160+
name: Retry the extension build
161+
uses: PyO3/maturin-action@v1
162+
if: inputs.prebuilt-run-id == '' && steps.extension.outcome == 'failure'
163+
continue-on-error: ${{ runner.os != 'Linux' }}
164+
with:
165+
command: build
166+
# One platform records a cargo build timing report for build time work.
167+
args: >-
168+
--profile ${{ inputs.cargo-profile }} --out dist --features extension-module
169+
${{ matrix.platform.name == 'linux-x86_64' && '--timings' || '' }}
170+
target: ${{ matrix.platform.target }}
171+
manylinux: auto
172+
- name: Build the extension with maturin from PyPI
173+
if: >-
174+
inputs.prebuilt-run-id == '' && runner.os != 'Linux'
175+
&& steps.extension.outcome == 'failure' && steps.extension-retry.outcome == 'failure'
176+
shell: bash
177+
env:
178+
MATURIN_ARGS: >-
179+
--profile ${{ inputs.cargo-profile }} --out dist --features extension-module
180+
TARGET: ${{ matrix.platform.target }}
181+
run: scripts/maturin_from_pypi.sh build ${MATURIN_ARGS}
182+
- id: cli
183+
uses: PyO3/maturin-action@v1
155184
if: inputs.prebuilt-run-id == ''
185+
continue-on-error: true
156186
# On macOS maturin links the extension with these flags for every crate, which changes
157187
# their build hash. Passing the same flags here lets sqb reuse the crates the extension
158188
# build just compiled instead of compiling them again; sqb has no undefined symbols, and
@@ -169,6 +199,37 @@ jobs:
169199
${{ matrix.platform.name == 'linux-x86_64' && '--timings' || '' }}
170200
target: ${{ matrix.platform.target }}
171201
manylinux: auto
202+
- id: cli-retry
203+
name: Retry the sqb build
204+
uses: PyO3/maturin-action@v1
205+
if: inputs.prebuilt-run-id == '' && steps.cli.outcome == 'failure'
206+
continue-on-error: ${{ runner.os != 'Linux' }}
207+
env:
208+
RUSTFLAGS: >-
209+
${{ runner.os == 'macOS' && '-C link-arg=-undefined -C link-arg=dynamic_lookup' || '' }}
210+
# A wheel must never ship a sqb server without its UI.
211+
SQLBUILD_UI_REQUIRED: "1"
212+
with:
213+
command: build
214+
args: >-
215+
--profile ${{ inputs.cargo-profile }} --out dist --manifest-path crates/sqlbuild-cli/Cargo.toml --features ui
216+
${{ matrix.platform.name == 'linux-x86_64' && '--timings' || '' }}
217+
target: ${{ matrix.platform.target }}
218+
manylinux: auto
219+
- name: Build sqb with maturin from PyPI
220+
if: >-
221+
inputs.prebuilt-run-id == '' && runner.os != 'Linux'
222+
&& steps.cli.outcome == 'failure' && steps.cli-retry.outcome == 'failure'
223+
shell: bash
224+
env:
225+
RUSTFLAGS: >-
226+
${{ runner.os == 'macOS' && '-C link-arg=-undefined -C link-arg=dynamic_lookup' || '' }}
227+
# A wheel must never ship a sqb server without its UI.
228+
SQLBUILD_UI_REQUIRED: "1"
229+
MATURIN_ARGS: >-
230+
--profile ${{ inputs.cargo-profile }} --out dist --manifest-path crates/sqlbuild-cli/Cargo.toml --features ui
231+
TARGET: ${{ matrix.platform.target }}
232+
run: scripts/maturin_from_pypi.sh build ${MATURIN_ARGS}
172233
- name: Upload the cargo build timing reports
173234
if: inputs.prebuilt-run-id == '' && matrix.platform.name == 'linux-x86_64'
174235
uses: actions/upload-artifact@v4
@@ -286,16 +347,46 @@ jobs:
286347
if: inputs.prebuilt-run-id == ''
287348
with:
288349
toolchain: stable
289-
- uses: PyO3/maturin-action@v1
350+
- id: sdist
351+
uses: PyO3/maturin-action@v1
290352
if: inputs.prebuilt-run-id == ''
353+
continue-on-error: true
291354
with:
292355
command: sdist
293356
args: --out dist
294-
- uses: PyO3/maturin-action@v1
357+
- id: sdist-retry
358+
name: Retry the source distribution
359+
uses: PyO3/maturin-action@v1
360+
if: inputs.prebuilt-run-id == '' && steps.sdist.outcome == 'failure'
361+
continue-on-error: true
362+
with:
363+
command: sdist
364+
args: --out dist
365+
- name: Build the source distribution with maturin from PyPI
366+
if: >-
367+
inputs.prebuilt-run-id == '' && steps.sdist.outcome == 'failure'
368+
&& steps.sdist-retry.outcome == 'failure'
369+
run: scripts/maturin_from_pypi.sh sdist --out dist
370+
- id: sdist-cli
371+
uses: PyO3/maturin-action@v1
295372
if: inputs.prebuilt-run-id == ''
373+
continue-on-error: true
374+
with:
375+
command: sdist
376+
args: --out dist --manifest-path crates/sqlbuild-cli/Cargo.toml
377+
- id: sdist-cli-retry
378+
name: Retry the sqb source distribution
379+
uses: PyO3/maturin-action@v1
380+
if: inputs.prebuilt-run-id == '' && steps.sdist-cli.outcome == 'failure'
381+
continue-on-error: true
296382
with:
297383
command: sdist
298384
args: --out dist --manifest-path crates/sqlbuild-cli/Cargo.toml
385+
- name: Build the sqb source distribution with maturin from PyPI
386+
if: >-
387+
inputs.prebuilt-run-id == '' && steps.sdist-cli.outcome == 'failure'
388+
&& steps.sdist-cli-retry.outcome == 'failure'
389+
run: scripts/maturin_from_pypi.sh sdist --out dist --manifest-path crates/sqlbuild-cli/Cargo.toml
299390
- name: Download prebuilt source distributions
300391
if: inputs.prebuilt-run-id != ''
301392
uses: actions/download-artifact@v4

‎.github/workflows/compiler-differential.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
models: [3000, 10000]
2424
steps:
2525
- uses: actions/checkout@v4
26-
- uses: astral-sh/setup-uv@v5
26+
- uses: ./.github/actions/setup-uv
2727
with:
2828
version: "0.12.3"
2929
enable-cache: true

‎.github/workflows/release-performance.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
with:
5353
# Release tags identify the previous release before its wheels reach PyPI.
5454
fetch-depth: 0
55-
- uses: astral-sh/setup-uv@v5
55+
- uses: ./.github/actions/setup-uv
5656
with:
5757
version: "0.12.3"
5858
enable-cache: true

‎.github/workflows/release-please.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
ref: ${{ steps.release_branch.outputs.name }}
7575
token: ${{ steps.delivery-token.outputs.token }}
7676

77-
- uses: astral-sh/setup-uv@v5
77+
- uses: ./.github/actions/setup-uv
7878
if: steps.release.outputs.prs_created == 'true'
7979
with:
8080
version: "0.12.3"

‎.github/workflows/rust-cache.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
timeout-minutes: 60
2828
steps:
2929
- uses: actions/checkout@v4
30-
- uses: astral-sh/setup-uv@v5
30+
- uses: ./.github/actions/setup-uv
3131
with:
3232
version: "0.12.3"
3333
- uses: dtolnay/rust-toolchain@master
@@ -58,7 +58,7 @@ jobs:
5858
timeout-minutes: 60
5959
steps:
6060
- uses: actions/checkout@v4
61-
- uses: astral-sh/setup-uv@v5
61+
- uses: ./.github/actions/setup-uv
6262
with:
6363
version: "0.12.3"
6464
- uses: dtolnay/rust-toolchain@master
@@ -97,7 +97,7 @@ jobs:
9797
shell: bash
9898
steps:
9999
- uses: actions/checkout@v4
100-
- uses: astral-sh/setup-uv@v5
100+
- uses: ./.github/actions/setup-uv
101101
with:
102102
version: "0.12.3"
103103
- uses: dtolnay/rust-toolchain@master

‎.github/workflows/scope-performance.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
timeout-minutes: 30
2020
steps:
2121
- uses: actions/checkout@v4
22-
- uses: astral-sh/setup-uv@v5
22+
- uses: ./.github/actions/setup-uv
2323
with:
2424
version: "0.12.3"
2525
enable-cache: true

0 commit comments

Comments
 (0)