feat: Parameterized Queries #341
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test code base | |
| on: | |
| pull_request: | |
| branches: | |
| - trunk | |
| push: | |
| branches: | |
| - trunk | |
| - release-* | |
| tags: | |
| - v* | |
| workflow_dispatch: | |
| jobs: | |
| test_pip_install: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ['3.9', '3.10', '3.11', '3.12'] | |
| name: Test pip install (Python ${{ matrix.python-version }}) | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| 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.9', '3.10', '3.11', '3.12'] | |
| name: Unit tests on ${{ matrix.os }} (Python ${{ matrix.python-version }}) | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| 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.9', '3.10', '3.11', '3.12'] | |
| name: Integration tests on ${{ matrix.os }} (Python ${{ matrix.python-version }}) | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| 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 | |
| - name: install Spice (Windows) | |
| if: matrix.os == 'windows-latest' | |
| run: | | |
| curl -L "https://install.spiceai.org/Install.ps1" -o Install.ps1 && PowerShell -ExecutionPolicy Bypass -File ./Install.ps1 | |
| - name: add Spice bin to PATH (Windows) | |
| if: matrix.os == 'windows-latest' | |
| run: | | |
| Add-Content $env:GITHUB_PATH (Join-Path $HOME ".spice\bin") | |
| shell: pwsh | |
| - 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 & | |
| # time to initialize added dataset | |
| sleep 10 | |
| - name: Init and start spice app (Windows) | |
| if: matrix.os == 'windows-latest' | |
| run: | | |
| spice init spice_qs | |
| cd spice_qs | |
| spice add spiceai/quickstart | |
| Start-Process -FilePath spice run | |
| # time to initialize added dataset | |
| Start-Sleep -Seconds 10 | |
| shell: pwsh | |
| - 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: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'}} | |
| run: | | |
| pytest -s tests/test_main.py | |
| - name: Stop spice and check logs | |
| working-directory: spice_qs | |
| if: matrix.os != 'windows-latest' && always() | |
| run: | | |
| killall spice || true | |
| cat spice.log | |
| coverage: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ['3.9', '3.10', '3.11', '3.12'] | |
| name: Test coverage (Python ${{ matrix.python-version }}) | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| 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@v4 | |
| with: | |
| files: ./coverage.xml | |
| fail_ci_if_error: false | |
| verbose: true |