Skip to content

chore(deps): bump the uv group across 1 directory with 2 updates #402

chore(deps): bump the uv group across 1 directory with 2 updates

chore(deps): bump the uv group across 1 directory with 2 updates #402

Workflow file for this run

name: Test code base
on:
pull_request:
branches:
- trunk
push:
branches:
- trunk
- release-*
tags:
- v*
workflow_dispatch:
permissions:
contents: read
jobs:
test_pip_install:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.11', '3.12', '3.13', '3.14']
name: Test pip install (Python ${{ matrix.python-version }})
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Run pip install
run: |
pip install .
pytest-unit:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.11', '3.12', '3.13', '3.14']
name: Unit tests on ${{ matrix.os }} (Python ${{ matrix.python-version }})
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install requirements
run: |
pip install ".[test]"
- name: Run unit tests
run: |
pytest -s -m "unit or not (integration or cloud or slow)" --ignore=tests/test_main.py tests/
pytest-integration:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.11', '3.12', '3.13', '3.14']
name: Integration tests on ${{ matrix.os }} (Python ${{ matrix.python-version }})
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install requirements
run: |
pip install ".[test]"
- name: Install Spice (https://install.spiceai.org) (Linux)
if: matrix.os == 'ubuntu-latest'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
curl https://install.spiceai.org | /bin/bash
echo "$HOME/.spice/bin" >> $GITHUB_PATH
$HOME/.spice/bin/spice install
- name: Install Spice (https://install.spiceai.org) (MacOS)
if: matrix.os == 'macos-latest'
run: |
brew install spiceai/spiceai/spice
brew install spiceai/spiceai/spiced
# Spice on Windows is only supported via WSL. Set up Ubuntu under WSL
# and install Spice there; the tests on the Windows host then talk to
# the runtime over localhost (WSL2 forwards localhost between host and
# guest).
- name: Set up WSL (Windows)
if: matrix.os == 'windows-latest'
uses: Vampire/setup-wsl@887f39deb6c0976365e546926fe66f41b77d65ff # v6.1.0
with:
distribution: Ubuntu-24.04
additional-packages: |
curl
ca-certificates
- name: install Spice in WSL (Windows)
if: matrix.os == 'windows-latest'
shell: wsl-bash {0}
run: |
curl https://install.spiceai.org | /bin/bash
$HOME/.spice/bin/spice install
- name: Init and start spice app
if: matrix.os != 'windows-latest'
run: |
spice init spice_qs
cd spice_qs
spice add spiceai/quickstart
spiced &> spice.log &
# Wait for runtime to be ready (poll /v1/ready endpoint)
for i in {1..60}; do
if curl -s http://localhost:8090/v1/ready > /dev/null 2>&1; then
echo "Spice runtime is ready"
break
fi
echo "Waiting for Spice runtime to be ready... ($i/60)"
sleep 1
done
- name: Init and start spice app (Windows)
if: matrix.os == 'windows-latest'
shell: wsl-bash {0}
run: |
export PATH="$HOME/.spice/bin:$PATH"
spice init spice_qs
cd spice_qs
spice add spiceai/quickstart
nohup spiced > spice.log 2>&1 &
# Wait for runtime to be ready (poll /v1/ready endpoint)
for i in $(seq 1 120); do
if curl -s http://localhost:8090/v1/ready > /dev/null 2>&1; then
echo "Spice runtime is ready"
exit 0
fi
echo "Waiting for Spice runtime to be ready... ($i/120)"
sleep 1
done
echo "=== spice log ==="
cat spice.log || true
echo "Spice runtime did not become ready within 120 seconds"
exit 1
- name: Running tests
env:
API_KEY: ${{ secrets.API_KEY }}
# run spice.ai cloud tests only on linux with single python version, to avoid concurrent requests
TEST_SPICE_CLOUD: 'false'
run: |
pytest -s tests/test_main.py -k "not cloud"
- name: Stop spice and check logs
working-directory: spice_qs
if: matrix.os != 'windows-latest' && always()
run: |
killall spice || true
cat spice.log
- name: Stop spice and check logs (Windows)
if: matrix.os == 'windows-latest' && always()
shell: wsl-bash {0}
run: |
pkill -f spiced || true
echo "=== spice log ==="
cat spice_qs/spice.log || true
pytest-cloud:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.12']
name: Cloud tests (Python ${{ matrix.python-version }})
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install requirements
run: |
pip install ".[test,params]"
- name: Run cloud tests
env:
SPICE_API_KEY: ${{ secrets.SCP_SPICEAI_TPCH_API_KEY }}
TEST_SPICE_CLOUD: 'true'
run: |
pytest -s tests/test_main.py -k "cloud"
coverage:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.11', '3.12', '3.13', '3.14']
name: Test coverage (Python ${{ matrix.python-version }})
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install requirements
run: |
pip install ".[test]"
- name: Run coverage
run: |
pytest --cov=spicepy --cov-report=xml --cov-report=term-missing --ignore=tests/test_main.py tests/
- name: Upload coverage to Codecov
if: matrix.python-version == '3.12'
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v4.5.0
with:
files: ./coverage.xml
fail_ci_if_error: false
verbose: true