Skip to content

Commit 40fb5af

Browse files
committed
ci: smoke test the published 0.3.0 release from PyPI on macOS
Temporary branch only: installs sqlquack 0.3.0 from PyPI on macOS 15 (Apple Silicon and Intel) and runs the README Python example and time-zone-dependent conversions.
1 parent 89eaa63 commit 40fb5af

2 files changed

Lines changed: 39 additions & 0 deletions

File tree

‎.github/pypi-smoke.sh‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
# PyPI smoke for a published sqlquack version: README Python example + time-zone-dependent convert/run.
3+
# Usage: smoke.sh <version> <policy.toml>
4+
set -euo pipefail
5+
V="$1"; POLICY="$(cd "$(dirname "$2")" && pwd)/$(basename "$2")"
6+
W="$(mktemp -d)"; "${PYTHON:-python3}" -m venv "$W/venv"; B="$W/venv/bin"
7+
"$B/python" -m pip install -q --no-cache-dir "sqlquack==$V"
8+
"$B/sqlquack" --version
9+
"$B/python" -c 'import sqlquack
10+
r = sqlquack.convert(sql="SELECT 1 AS total", options=sqlquack.ConvertOptions(builtin_policy=True))
11+
assert r.sql == "SELECT CAST(1 AS DECIMAL(1,0)) AS \"TOTAL\"", r.sql
12+
print("readme-python ok:", r.sql)'
13+
cd "$W"; cp "$POLICY" sqlquack.toml
14+
echo "SELECT '2024-03-10 22:30:00'::TIMESTAMP_NTZ(6)::TIMESTAMP_TZ AS placed_at" > tz.sql
15+
"$B/sqlquack" convert tz.sql
16+
out="$(TZ=America/New_York "$B/sqlquack" run tz.sql)"; echo "$out"; grep -q '^2024-03-10 22:30:00+00$' <<< "$out"
17+
echo "SELECT CONVERT_TIMEZONE('UTC', 'America/New_York', '2024-03-10 12:00:00'::TIMESTAMP_NTZ) AS local_at" > icu.sql
18+
out="$("$B/sqlquack" run icu.sql)"; echo "$out"; grep -q '^2024-03-10 08:00:00$' <<< "$out"
19+
echo "smoke ok: sqlquack $V on $(uname -sm)"

‎.github/workflows/pypi-smoke.yml‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Temporary: smoke test a published release from PyPI on macOS. Not for main.
2+
name: PyPI smoke
3+
on:
4+
push:
5+
branches: [smoke/pypi-macos]
6+
jobs:
7+
smoke:
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
runner: [macos-15, macos-15-intel]
12+
runs-on: ${{ matrix.runner }}
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-python@v5
16+
with:
17+
python-version: "3.12"
18+
- name: Install sqlquack 0.3.0 from PyPI and smoke test it
19+
shell: bash
20+
run: PYTHON=python bash .github/pypi-smoke.sh 0.3.0 sqlquack.toml

0 commit comments

Comments
 (0)